From f11691355ae9bd4dddf1f0ee3621d9064aaace6e Mon Sep 17 00:00:00 2001 From: amzrk2 Date: Thu, 18 Jun 2020 14:29:11 +0800 Subject: Optimize comment area setting logic --- README.md | 2 +- README_CN.md | 2 +- layouts/_default/single.html | 6 +++--- 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 @@ {{ 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 -- cgit v1.2.3