NexT主题下为Hexo博文添加版权信息

添加版权信息

打开themes目录下的/next/layout/_macro/post.swig文件,找到post-footer标签,并添加如下代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<footer class="post-footer">
{% if post.tags and post.tags.length and not is_index %}
<div>
{% if not is_index %}
<ul class="post-copyright">
<li class="post-copyright-author">
<strong>本文作者:</strong>{{ theme.author }}
</li>
<li class="post-copyright-link">
<strong>本文链接:</strong>
<a href="{{ url_for(page.path) }}" title="{{ page.title }}">{{ page.path }}</a>
</li>
<li class="post-copyright-license">
<strong>许可协议: </strong>
除特殊声明外,本站博文均采用 <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/cn/" rel="external nofollow" target="_blank">CC BY-NC-SA 3.0 CN</a> 许可协议,转载请注明出处!
</li>
</ul>
{% endif %}
</div>

版权信息格式

打开themes目录下的/next/source/css/_custom/custom.styl 文件,并添加如下代码:

1
2
3
4
5
6
7
.post-copyright {
margin: 0.5em 0 0;
padding: 0.5em 1em;
border-left: 3px solid #ff1700;
background-color: #f8f8f8;
list-style: none;
}

大爷,赏个铜板呗~