diff --git a/_config.yml b/_config.yml index 6c9f8aca7..6e9735bde 100755 --- a/_config.yml +++ b/_config.yml @@ -22,6 +22,13 @@ authoricon: heart # Footer `powered-by` and `theme-info` copyright copyright: true +# Declare license on posts +post_copyright: + enable: false + license: CC BY-NC-SA 3.0 CN + license_url: http://creativecommons.org/licenses/by-nc-sa/3.0/cn/ + + # Canonical, set a canonical link tag in your hexo, you could use it for your SEO of blog. # See: https://support.google.com/webmasters/answer/139066 # Tips: Before you open this tag, remember set up your URL in hexo _config.yml ( ex. url: http://yourdomain.com ) diff --git a/layout/_macro/post-copyright.swig b/layout/_macro/post-copyright.swig new file mode 100644 index 000000000..480837787 --- /dev/null +++ b/layout/_macro/post-copyright.swig @@ -0,0 +1,7 @@ +{% if theme.post_copyright.enable %} +
+ 本文链接: {{ config.url }}{{ url_for(path) }} +
+ 版权声明:本博客所有文章除特别声明外,均采用{{ theme.post_copyright.license }}许可协议。转载请注明出处!
+
+{% endif %} diff --git a/layout/_macro/post.swig b/layout/_macro/post.swig index 550faf592..f6af584c9 100644 --- a/layout/_macro/post.swig +++ b/layout/_macro/post.swig @@ -308,6 +308,11 @@ {% endif %} +
+ {% if not is_index %} + {% include 'post-copyright.swig' %} + {% endif %} +