themes/next/_config.yml
# Creative Commons 4.0 International License.
# See: https://creativecommons.org/share-your-work/licensing-types-examples
# Available values of license: by | by-nc | by-nc-nd | by-nc-sa | by-nd | by-sa | zero
# You can set a language value if you prefer a translated version of CC license, e.g. deed.zh
# CC licenses are available in 39 languages, you can find the specific and correct abbreviation you need on https://creativecommons.org
creative_commons:
license: by-nc-sa
sidebar: false
post: true
language:
post的值改为true表示文章开启添加版权信息。
打开themes/next/layout/_macro/post.swig
找到creative_commons那一行改为:
{%- if theme.creative_commons.license and theme.creative_commons.post and page.copyright %}
{{ partial('_partials/post/post-copyright.swig') }}
{%- endif %}
就是添加了 page.copyright
,这样就可以单独控制某篇文章是否添加版权信息了。
可以修改模板文件,这样默认就有 copyright: true
模板文件在scaffolds/post.md
hexo next主题给文章添加版权信息