Skip to content

Commit

Permalink
🐛 文章没有分类则隐藏分类栏
Browse files Browse the repository at this point in the history
  • Loading branch information
zkqiang committed Aug 18, 2019
1 parent 7936248 commit f08f783
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
16 changes: 9 additions & 7 deletions layout/post.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ page.banner_img_height = theme.post.banner_img_height
</div>
<br>
<div>
<p>
<i class="iconfont icon-inbox"></i>
<% page.categories.each(function(cate) { %>
<a class="hover-with-bg" href="/categories/<%- encodeURI(cate.name) %>"><%= cate.name %></a>
&nbsp;
<% }) %>
</p>
<% if (page.categories.length != 0) { %>
<p>
<i class="iconfont icon-inbox"></i>
<% page.categories.each(function(cate) { %>
<a class="hover-with-bg" href="/categories/<%- encodeURI(cate.name) %>"><%= cate.name %></a>
&nbsp;
<% }) %>
</p>
<% } %>
<p>
<i class="iconfont icon-tag"></i>
<% page.tags.each(function(tag) { %>
Expand Down
10 changes: 6 additions & 4 deletions source/css/_pages/_base/base.styl
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,17 @@ body
padding-left 0 !important
padding-right 0 !important

.hr
height .2em
margin 2rem 0

.row
padding-top 0.5rem
padding-bottom 0.5rem


// Rewrite github-markdown.css

.markdown-body hr
height .2em
margin 2rem 0

// Rewrite mdb.css

.list-group-item
Expand Down

0 comments on commit f08f783

Please sign in to comment.