diff --git a/themes/future/layout/_partial/post/tag.ejs b/themes/future/layout/_partial/post/tag.ejs index 5177f99aad5c..7a1eba667816 100644 --- a/themes/future/layout/_partial/post/tag.ejs +++ b/themes/future/layout/_partial/post/tag.ejs @@ -1,11 +1,16 @@ <% if (post.tags && post.tags.length){ %> - <% post.tags.forEach(function(tag, i){ %> - <% + <% + // post.tagsを配列に変換し、記事数(length)の降順でソートしてからループする + post.tags.toArray().sort((a, b) => b.length - a.length).forEach(function(tag, i){ let displayTagName = tag.name; if (displayTagName === "Go") { // Lighthouse対応 displayTagName = "Go言語"; - } - %> - <%= displayTagName %> + } + %> + <% if (tag.length > 1) { %> + <%= displayTagName %> + <% } else { %> + <%= displayTagName %> + <% } %> <% }); %> <% } %> diff --git a/themes/future/source/css/theme-styles.styl b/themes/future/source/css/theme-styles.styl index a8e389935c27..ca6a682540c9 100644 --- a/themes/future/source/css/theme-styles.styl +++ b/themes/future/source/css/theme-styles.styl @@ -671,6 +671,21 @@ code { color: #fff; text-decoration: none; } + +.tag-list-text { + color: #616161; + position: relative; + margin: 4px 6px 7px 4px; + display: inline-block; + box-sizing: border-box; + padding: 2px 8px 1px 8px; + background-color: #f5f5f3; + border-radius: 14px; + font-size: 12px; + color: #616161; + line-height: 1.4; +} + .blog-tags li a span { font-size: 0.5em; margin-left:5px;