Skip to content

Commit

Permalink
feat: copyright info 文末添加版权等信息
Browse files Browse the repository at this point in the history
Add a division to show copyright info
at the bottom of article automatically;
Hide the copyright info via putting
“original: false” to post’s front-matter.
添加一个方框展示文章版权声明的信息,在文章
顶部插入行 original: false 关闭。

Time format - http://momentjs.com/
MOxFIVE/M-Hexo-Blog#13
  • Loading branch information
MOxFIVE committed Oct 17, 2015
1 parent f52344d commit 0e452a4
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
12 changes: 12 additions & 0 deletions layout/_partial/post/nav.ejs
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
<% if (post.original != false){ %>

This comment has been minimized.

Copy link
@Xuanwo

Xuanwo Oct 23, 2015

= =,!=false,我改成swig之后直接写了!post.original,debug了半天,然后发现并不需要取反。。

This comment has been minimized.

Copy link
@ydx1013

ydx1013 Nov 18, 2015

按照这个添加的,可是总是乱吗,为什么啊?

This comment has been minimized.

Copy link
@MOxFIVE

MOxFIVE Nov 19, 2015

Author Owner

@ydx1013 按理应该可以,看不到你改的代码,不好判断问题所在。

<div class="copyright">
<p><span>本文标题:</span><a href="<%- url_for(post.path) %>"><%= post.title %></a></p>
<p><span>文章作者:</span><a href="/" title="访问 <%=theme.author%> 的个人博客"><%=theme.author%></a></p>
<p><span>发布时间:</span><%= post.date.format("YYYY年M月D日 - HH时MM分") %></p>
<p><span>最后更新:</span><%= post.updated.format("YYYY年M月D日 - HH时MM分") %></p>

This comment has been minimized.

Copy link
@MOxFIVE

MOxFIVE Nov 19, 2015

Author Owner

fix: c732947

<p><span>原始链接:</span><a href="<%- url_for(post.path) %>" title="<%= post.title %>"><%= post.permalink %></a></p>
<p><span>许可协议:</span><i class="fa fa-creative-commons"></i> <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/cn/" title="中国大陆 (CC BY-NC-SA 3.0 CN)">"署名-非商用-相同方式共享 3.0"</a> 转载请保留以上信息。</p>
</div>
<% } else { %>
<% } %>

<% if (post.prev || post.next){ %>
<nav id="article-nav">
<% if (post.prev){ %>
Expand Down
24 changes: 24 additions & 0 deletions source/css/_partial/article.styl
Original file line number Diff line number Diff line change
Expand Up @@ -492,4 +492,28 @@ li:hover {
.toc-link:hover {
background: rgba(158, 188, 226, .21);
}
}
.copyright {
width: 85%;
margin: 0px auto;
max-width: 45em;
word-break: break-all;
font-size: .93em;
line-height: 1.6em;
padding: .5em 1.8em;
background: rgba(255, 255, 255, .4)
border: 1px solid lightgray;
span {
color: #B5B5B5;
font-weight: bold;
margin-right: 1em;
}
a {
color: gray;
&:hover {
font-weight: bold;
color: #a3d2a3;
text-decoration: underline;
};
}
}
4 changes: 4 additions & 0 deletions source/css/_partial/mobile.styl
Original file line number Diff line number Diff line change
Expand Up @@ -287,4 +287,8 @@
a {
color: #767676;
}
}
.copyright {
width: 90%;
padding: .5em 1.3em;
}

0 comments on commit 0e452a4

Please sign in to comment.