From cf55a10e8d6222d7defe94184dc2e69009280c53 Mon Sep 17 00:00:00 2001 From: XPoet Date: Fri, 28 Oct 2022 15:06:33 +0800 Subject: [PATCH] build(config): `copyright_info` move to `post.copyright_info` --- _config.yml | 31 ++++++++++++-------------- layout/article-content.ejs | 2 +- source/css/layout/article-content.styl | 3 +-- 3 files changed, 16 insertions(+), 20 deletions(-) diff --git a/_config.yml b/_config.yml index 8376eca..84ced8c 100644 --- a/_config.yml +++ b/_config.yml @@ -129,17 +129,6 @@ home_article: # Post page Settings # --------------------------------------------------------------------------------------- post: - # Image align position in the post - img_align: left # Option values: left | center - - # Post word count - # Dependencies: hexo-wordcount (`npm install hexo-wordcount`) - # See: https://github.com/willin/hexo-wordcount - word_count: - enable: false # Option values: true | false - wordcount: false # Word count, one article. Option values: true | false - min2read: false # Time to read, one article. Option values: true | false - # Author label in the post author_label: enable: true # Option values: true | false @@ -151,6 +140,20 @@ post: # Label array item can be fill one or more custom_label_list: ["Trainee", "Engineer", "Architect"] + # Post word count + # Dependencies: hexo-wordcount (`npm install hexo-wordcount`) + # See: https://github.com/willin/hexo-wordcount + word_count: + enable: false # Option values: true | false + wordcount: false # Word count, one article. Option values: true | false + min2read: false # Time to read, one article. Option values: true | false + + # Image align position in the post + img_align: left # Option values: left | center + + # Post copyright info + copyright_info: false # Option values: true | false + # --------------------------------------------------------------------------------------- # Code block # Support code copy and code block collapse @@ -177,12 +180,6 @@ toc: # If true, open TOC every time when you enter the article page init_open: false # Option values: true | false -# --------------------------------------------------------------------------------------- -# Post copyright info -# --------------------------------------------------------------------------------------- -copyright_info: - enable: false # Option values: true | false - # --------------------------------------------------------------------------------------- # Website count # --------------------------------------------------------------------------------------- diff --git a/layout/article-content.ejs b/layout/article-content.ejs index c567d78..9d5df90 100644 --- a/layout/article-content.ejs +++ b/layout/article-content.ejs @@ -35,7 +35,7 @@ <%- page.content %> - <% if (theme.copyright_info.enable) { %> + <% if (theme.post?.copyright_info === true || theme?.copyright_info?.enable === true) { %>
<%- partial('_partial/article-copyright-info') %>
diff --git a/source/css/layout/article-content.styl b/source/css/layout/article-content.styl index f1b679d..c8aac35 100644 --- a/source/css/layout/article-content.styl +++ b/source/css/layout/article-content.styl @@ -145,7 +145,7 @@ $toc-container-width = 15rem color var(--text-color-3) word-wrap break-word - if (hexo-config('copyright_info.enable') == true) { + if (hexo-config('post.copyright_info') == true || hexo-config('copyright_info.enable') == true) { border-bottom 0.1rem dashed var(--border-color) } } @@ -278,4 +278,3 @@ $toc-container-width = 15rem } } } -