summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoramzrk22020-06-18 14:29:11 +0800
committeramzrk22020-06-18 14:29:11 +0800
commitf11691355ae9bd4dddf1f0ee3621d9064aaace6e (patch)
tree44157bea00f5b7ae0959d083f4237b0c730aacf7
parent5c68750e0cd265464aa55b1f1d89e54f7e71ccc0 (diff)
downloadhugo-theme-fuji-f11691355ae9bd4dddf1f0ee3621d9064aaace6e.tar.gz
hugo-theme-fuji-f11691355ae9bd4dddf1f0ee3621d9064aaace6e.tar.bz2
hugo-theme-fuji-f11691355ae9bd4dddf1f0ee3621d9064aaace6e.zip
Optimize comment area setting logic
-rw-r--r--README.md2
-rw-r--r--README_CN.md2
-rw-r--r--layouts/_default/single.html6
3 files changed, 5 insertions, 5 deletions
diff --git a/README.md b/README.md
index e943603..caa0c99 100644
--- a/README.md
+++ b/README.md
@@ -95,7 +95,7 @@ showToc = true # Enable or disable ToC for this specific post
To disable comment area for specific post, add this in front matter:
```toml
-noComments = true # Do not show comments in this post
+showComments = false # Do not show comments in this post
```
### 🎵 APlayer
diff --git a/README_CN.md b/README_CN.md
index 75d1c86..f3e082c 100644
--- a/README_CN.md
+++ b/README_CN.md
@@ -85,7 +85,7 @@ showToc = true # 对这篇文章开关目录显示
除此之外你也可以关闭特定文章的评论:
```toml
-noComments = true # 对这篇文章关闭评论
+showComments = false # 对这篇文章关闭评论
```
### 🎵 文章音乐
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 26a8213..8f7eb35 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -24,11 +24,11 @@
</blockquote>
</div>
{{ end }}
-{{ if .Site.Params.disqusJSApi }}
+{{ if and (.Site.Params.disqusJSApi) (ne .Params.showComments false) }}
{{ partial "comment-disqusjs.html" . }}
-{{ else if .Site.Params.disqusShortname }}
+{{ else if and (.Site.Params.disqusShortname) (ne .Params.showComments false) }}
{{ partial "comment-disqus.html" . }}
-{{ else if .Site.Params.utterancesRepo }}
+{{ else if and (.Site.Params.utterancesRepo) (ne .Params.showComments false) }}
{{ partial "comment-utterances.html" . }}
{{ else }}{{ end }}
{{ end }} \ No newline at end of file