diff --git a/languages/en.yml b/languages/en.yml index bb292c44..b1107607 100644 --- a/languages/en.yml +++ b/languages/en.yml @@ -2,6 +2,8 @@ common: archives: 'Archives' category: 'Category' tag: 'Tag' + categories: 'Categories' + tags: 'Tags' nav: next: 'Next' prev: 'Prev' diff --git a/languages/zh-cn.yml b/languages/zh-cn.yml index ffa509ef..c293a43a 100644 --- a/languages/zh-cn.yml +++ b/languages/zh-cn.yml @@ -2,6 +2,8 @@ common: archives: '归档' category: '分类' tag: '标签' + categories: '分类' + tags: '标签' nav: next: '下一页' prev: '上一页' diff --git a/layout/categories.ejs b/layout/categories.ejs index 0f82c365..bf0b253d 100644 --- a/layout/categories.ejs +++ b/layout/categories.ejs @@ -1,3 +1,18 @@ -<% page._categories.forEach(category => {%> -<%= category.name %> -<% }) %> \ No newline at end of file +
+
+
+
<%= __('common.categories') %>
+
+
+
+
+
+
+ <% (page._categories || page.categories).forEach(category => {%> + + + + <% }) %> +
+
+
\ No newline at end of file diff --git a/layout/common/article.ejs b/layout/common/article.ejs index 5eabe6e2..9599317f 100644 --- a/layout/common/article.ejs +++ b/layout/common/article.ejs @@ -37,9 +37,9 @@ <% } %> <% if (!index && post.tags && post.tags.length){ %> -
+
<% (post._tags || post.tags).forEach(tag => { %> - #<%= tag.name %> + <% }) %>
<% } %> diff --git a/layout/tags.ejs b/layout/tags.ejs index b26f01f4..0565263a 100644 --- a/layout/tags.ejs +++ b/layout/tags.ejs @@ -1,3 +1,18 @@ -<% page._tags.forEach(tag => {%> -<%= tag.name %> -<% }) %> \ No newline at end of file +
+
+
+
#<%= __('common.tags') %>
+
+
+
+
+
+
+ <% (page._tags || page.tags).forEach(tag => {%> + + + + <% }) %> +
+
+
\ No newline at end of file diff --git a/scripts/10_i18n.js b/scripts/10_i18n.js index 20317c63..9aba74a7 100644 --- a/scripts/10_i18n.js +++ b/scripts/10_i18n.js @@ -232,7 +232,8 @@ hexo.extend.generator.register('categories', withLanguage(function(languages, lo return null; } return Object.assign({}, category, { - posts: posts + posts: posts, + path: i === 0 ? category.path : pathJoin(language, category.path) }); }).filter(category => category !== null); return { @@ -257,7 +258,8 @@ hexo.extend.generator.register('tags', withLanguage(function(languages, locals) return null; } return Object.assign({}, tag, { - posts: posts + posts: posts, + path: i === 0 ? tag.path : pathJoin(language, tag.path) }); }).filter(category => category !== null); return { diff --git a/source/css/style.scss b/source/css/style.scss index b3ef93e7..3adeb014 100644 --- a/source/css/style.scss +++ b/source/css/style.scss @@ -8,6 +8,12 @@ body, button, input, select, textarea { font-family: $family-serif; } + +a.tag.article-tag { + font-size: 0.9rem; + text-decoration: none; +} + @media screen and (min-width: 1024px) { .container { max-width: 800px; @@ -93,19 +99,6 @@ body, button, input, select, textarea { } } - .article-tags { - .column:not(:first-child) { - margin-left: -.75rem; - } - - span a { - color: inherit; - background: #f2f2f2; - padding: 0.2rem 0.5rem; - border-radius: 3px; - } - } - .article-nav { a { color: darkgray;