diff --git a/README.md b/README.md index 9d5c062b6..5aa1fa6f5 100644 --- a/README.md +++ b/README.md @@ -151,12 +151,25 @@ Remove toc and the button via putting `toc: false` before "---" at [post].md. 文章中默认显示目录和对应切换按钮,在文章 “---” 前输入 `toc: false` 关闭目录。 +Hide toc in default | 默认不显示目录 + +> Set `toc: false` in `yelee/_config.yml`. + +(*Set `toc: true` in front-matter to show it in certain post*) + + #### 7. Copyright info. 文章版权信息: -Hide this via putting `original: false` to post's front-matter. +Hide this via putting `original: false` to post's front-matter. 在文章顶部插入行 `original: false` 关闭文章版权声明框 +Hide Copyright info. in default | 默认不显示版权信息 + +> Set `copyright: false` in `yelee/_config.yml`. + +(*Set `original: true` in front-matter to show it in certain post*) + #### 8. 404 Page: ``` diff --git a/_config.yml b/_config.yml index 7e84eb485..221a62baf 100644 --- a/_config.yml +++ b/_config.yml @@ -101,6 +101,12 @@ blockquote_style: # 左边栏宽度 px left_col_width: 300 +# Copyright info. of post | 文末版权信息 +copyright: true + +# Table of contents | 文章目录 +toc: true + # 目录中标题不换行 # Keep TOC title on the same line | toc_nowrap: false diff --git a/layout/_partial/article.ejs b/layout/_partial/article.ejs index 7bfd5792f..ad78cc91e 100644 --- a/layout/_partial/article.ejs +++ b/layout/_partial/article.ejs @@ -56,11 +56,11 @@ <%- partial('post/nav') %> <% } %> -<% if (!index && post.toc != false && !is_page()){ %> +<% if (!index && ((post.toc != false && !is_page() && theme.toc) || post.toc)){ %> <%- partial('_partial/toc') %> <% } %> <% if (!index && theme.share){ %> -<%- partial('post/share') %> + <%- partial('post/share') %> <% } %> <% if (!index && post.comments){ %> diff --git a/layout/_partial/post/nav.ejs b/layout/_partial/post/nav.ejs index 85475d3ad..b83d673ce 100644 --- a/layout/_partial/post/nav.ejs +++ b/layout/_partial/post/nav.ejs @@ -1,4 +1,4 @@ -<% if (post.original != false && !is_page()){ %> +<% if ((post.original != false && !is_page() && theme.copyright) || post.original){ %>