fix(microformat): prepend class name only to <a> tag

This commit is contained in:
curben 2019-06-28 17:49:12 +09:30
parent 04f6762388
commit b9db47fe8c
3 changed files with 3 additions and 3 deletions

View File

@ -2,7 +2,7 @@
<div class="article-category"> <div class="article-category">
<%- list_categories(post.categories, { <%- list_categories(post.categories, {
show_count: false, show_count: false,
class: 'p-category article-category', class: 'article-category',
style: 'none', style: 'none',
separator: '/' separator: '/'
}) %> }) %>

View File

@ -1,7 +1,7 @@
<% if (post.tags && post.tags.length) { %> <% if (post.tags && post.tags.length) { %>
<%- listTags(post.tags, { <%- listTags(post.tags, {
show_count: false, show_count: false,
class: 'p-category article-tag', class: 'article-tag',
transform: titlecase transform: titlecase
}) %> }) %>
<% } %> <% } %>

View File

@ -39,7 +39,7 @@ function listTagsHelper(tags, options) {
tags.forEach(tag => { tags.forEach(tag => {
result += `<li class="${className}-list-item">` result += `<li class="${className}-list-item">`
result += `<a class="${className}-list-link" href="${self.url_for(tag.path)}${suffix}" rel="tag">` result += `<a class="p-category ${className}-list-link" href="${self.url_for(tag.path)}${suffix}" rel="tag">`
result += transform ? transform(tag.name) : tag.name result += transform ? transform(tag.name) : tag.name
result += '</a>' result += '</a>'