diff --git a/_config.yml b/_config.yml index 74a2509..cccb4f9 100644 --- a/_config.yml +++ b/_config.yml @@ -90,6 +90,25 @@ home_article: limit: 5 # max number of tags shown in home page article block +# --------------------------------------------------------------------------------------- +# Post page Settings +# --------------------------------------------------------------------------------------- +post: + # Post word count + # Dependencies: hexo-wordcount (npm install hexo-wordcount) + # See: https://github.com/willin/hexo-wordcount + word_count: + enable: false + wordcount: false # word count, one article + min2read: false # time to read, one article + + author_label: + enable: true + auto: true # if true, show Lv1, Lv2, Lv3... , If false, show custom label + # label array item can be one or more + custom_label_list: [ "Trainee", "Engineer", "Architect", "CTO", "BOSS" ] + + # --------------------------------------------------------------------------------------- # Code copy # --------------------------------------------------------------------------------------- @@ -121,17 +140,6 @@ copyright_info: enable: false -# --------------------------------------------------------------------------------------- -# Post word count -# Dependencies: hexo-wordcount -# See: https://github.com/willin/hexo-wordcount -# --------------------------------------------------------------------------------------- -post_wordcount: - enable: false - wordcount: false # word count, one article - min2read: false # time to read, one article - - # --------------------------------------------------------------------------------------- # Website count # --------------------------------------------------------------------------------------- diff --git a/layout/_partial/article-meta-info.ejs b/layout/_partial/article-meta-info.ejs index 128e828..97f8983 100644 --- a/layout/_partial/article-meta-info.ejs +++ b/layout/_partial/article-meta-info.ejs @@ -37,12 +37,12 @@ temp_min2read_count = 0; } %> - <% if(is_post() && theme.post_wordcount.enable && theme.post_wordcount.wordcount && temp_wordcount_count){ %> + <% if(is_post() && theme.hasOwnProperty('post') && theme.post.word_count.enable && theme.post.word_count.wordcount && temp_wordcount_count){ %>
<% } %> - <% if(is_post() && theme.post_wordcount.enable && theme.post_wordcount.min2read && temp_min2read_count){ %> + <% if(is_post() && theme.hasOwnProperty('post') && theme.post.word_count.enable && theme.post.word_count.min2read && temp_min2read_count){ %> diff --git a/layout/article-content.ejs b/layout/article-content.ejs index a41909a..6ec987c 100644 --- a/layout/article-content.ejs +++ b/layout/article-content.ejs @@ -13,7 +13,9 @@