summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md6
-rw-r--r--README_CN.md8
-rw-r--r--layouts/partials/sidebar.html2
3 files changed, 10 insertions, 6 deletions
diff --git a/README.md b/README.md
index 8d0283c..573140b 100644
--- a/README.md
+++ b/README.md
@@ -71,19 +71,21 @@ Create `[SITEROOT]/layouts/partials/favicon.html` to cover theme's favicon.
You can generate your favicons in [realfavicongenerator.net](https://realfavicongenerator.net/).
-### ❌ In-post license & comments
+### ❌ In-post license, comments und toc
You can set variables below in post's front matter to disable them:
```toml
noLicense = true # Do not show license in this post
noComments = true # Do not show comments in this post
+noToc = true # Do not show toc in this post
```
-Or you can disable the license globally, set this below to false or comment it in your `config.toml`:
+Or you can disable these globally, set these below to false or comment it in your `config.toml`:
```toml
showLicense = false
+showToc = false
```
### 🎵 APlayer
diff --git a/README_CN.md b/README_CN.md
index 2da3478..7ea9dab 100644
--- a/README_CN.md
+++ b/README_CN.md
@@ -61,19 +61,21 @@ $ git submodule update --remote --merge
可以在 [realfavicongenerator.net](https://realfavicongenerator.net/) 快速创建自己的图标。
-### ❌ 关闭 License 和评论
+### ❌ 关闭 License、评论区和目录
-安全第一,在 front matter 里加上这些:
+在 front matter 里加上这些:
```toml
noLicense = true # 憋显示 License
noComments = true # 憋显示评论区
+noToc = true # 憋显示目录
```
-你也可以全局关闭 License 显示,在 `config.toml` 把下面这项设置为 false 或注释掉:
+你也可以全局关闭这些内容的显示,在 `config.toml` 把下面这些设置为 false 或注释掉:
```toml
showLicense = false
+showToc = false
```
### 🎵 文章音乐
diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html
index 8e902c1..7ead0e2 100644
--- a/layouts/partials/sidebar.html
+++ b/layouts/partials/sidebar.html
@@ -1,6 +1,6 @@
<aside class="col-12 col-md-3 float-left sidebar">
<!-- in-post toc -->
- {{ if in .Site.Params.mainSections .Type }}
+ {{ if and (in .Site.Params.mainSections .Type) (and (.Site.Params.showToc) (ne .Params.noToc true)) }}
<div class="sidebar-item sidebar-toc">
<h3>{{ i18n "sidebarToc" }}</h3>
{{ .TableOfContents }}