Permalink
Browse files

feat: post-nav-button 文章跳转按钮

button: next/prev article, home
  • Loading branch information...
MOxFIVE committed Oct 15, 2015
1 parent 9ba2727 commit bf44e18aadd306393d380f187c67325fe6502190
Showing with 54 additions and 1 deletion.
  1. +31 −1 themes/Yilia/layout/_partial/article.ejs
  2. +23 −0 themes/Yilia/source/css/_partial/article.styl
@@ -102,4 +102,34 @@
<a href="#ds-thread" title="查看评论"><i class="fa fa-comments-o"></i></a>
<a href="#footer" title="转到底部"><i class="fa fa-arrow-down"></i></a>
</div>
<% } %>
<% } %>
<% if (is_post()){ %>
<% if (post.prev && !post.next){ %>
<div class="post-nav-button">
<a href="<%- url_for(post.prev.path) %>" title="上一篇: <%= post.prev.title %>">
<i class="fa fa-angle-left"></i>
</a>
<a href="/" title="回到主页"><i class="fa fa-home"></i></a>
</div>
<% } %>
<% if (!post.prev && post.next){ %>
<div class="post-nav-button">
<a href="/" title="回到主页"><i class="fa fa-home"></i></a>
<a href="<%- url_for(post.next.path) %>" title="下一篇: <%= post.next.title %>">
<i class="fa fa-angle-right"></i>
</a>
</div>
<% } %>
<% if (post.prev && post.next){ %>
<div class="post-nav-button">
<a href="<%- url_for(post.prev.path) %>" title="上一篇: <%= post.prev.title %>">
<i class="fa fa-angle-left"></i>
</a>
<a href="<%- url_for(post.next.path) %>" title="下一篇: <%= post.next.title %>">
<i class="fa fa-angle-right"></i>
</a>
</div>
<% } %>
<% } %>
@@ -594,4 +594,27 @@ li:hover {
&::after {
content: " >";
};
}
.post-nav-button {
position: fixed;
left: 300px;
top: 61.8%;
text-align: center;
a {
display: block;
width: 29px;
font-size: 28px;
}
.fa {
color: rgba(255, 255, 255, .8);
padding-top: 16px;
padding-bottom: 16px;
}
a:hover {
background: rgba(147, 181, 224, .3);
.fa {
color: white;
}
}
}

0 comments on commit bf44e18

Please sign in to comment.