Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions themes/future/layout/_partial/post/tag.ejs
Original file line number Diff line number Diff line change
@@ -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言語";
}
%>
<a href="/<%= tag.path %>" title="<%= tag.name %>タグの記事へ" class="tag-list-link"><%= displayTagName %></a>
}
%>
<% if (tag.length > 1) { %>
<a href="/<%= tag.path %>" title="<%= tag.name %>タグの記事へ" class="tag-list-link"><%= displayTagName %></a>
<% } else { %>
<span title="このタグの記事は現在1つだけです" class="tag-list-text"><%= displayTagName %></span>
<% } %>
<% }); %>
<% } %>
15 changes: 15 additions & 0 deletions themes/future/source/css/theme-styles.styl
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading