add param commentOnAllPosts

This commit is contained in:
Mivinci 2021-11-29 01:04:53 +08:00
parent cbfde610e7
commit 6ff9489f84
3 changed files with 18 additions and 13 deletions

View file

@ -27,17 +27,20 @@ subtitle = ""
# Comment decides the comment plugin to be used on your blog site, # Comment decides the comment plugin to be used on your blog site,
# e.g. disqus, utterances, ovo. # e.g. disqus, utterances, ovo.
comment = "utterances" comment = "utterances"
# timeformat, no matter what format to use, make it the second day of Jan. 2006 # Timeformat, no matter what format to use, make it the second day of Jan. 2006
timeformat = "Jan 02, 2006" timeformat = "Jan 02, 2006"
# switch for turning on/off lights. # switch for turning on/off lights.
switch = ["🌚", "🌝"] switch = ["🌚", "🌝"]
# if true, date of posts will be displayed in the homepage. # If set true, date of posts will be displayed in the homepage.
displayDate = true displayDate = true
# if true, users can select text from your post. # If set true, users can select text from your post.
selectable = true selectable = true
# custom global font. notice: `globalFontFamily` won't be working # Custom global font. notice: `globalFontFamily` won't be working
# on texts in some special positions like on titles # on texts in some special positions like on titles
globalFontFamily = 'Helvatica sans-serif' globalFontFamily = 'Helvatica sans-serif'
# If set true, all your posts will use the chosen comment plugin
# except those with a `comment: false` in their front-matter
commentOnAllPosts = false
# Disqus configuration # Disqus configuration
[params.disqus] [params.disqus]

View file

@ -3,6 +3,7 @@ author: XJJ
title: 中文测试 title: 中文测试
date: 2021-07-17T10:52:59+08:00 date: 2021-07-17T10:52:59+08:00
description: description:
comment: false
--- ---
## 二级标题 ## 二级标题

View file

@ -36,16 +36,17 @@
{{ partial "mermaid.html" . }} {{ partial "mermaid.html" . }}
{{ end }} {{ end }}
{{ if and .Params.comment (eq .Site.Params.comment "disqus")}} {{ if and .Site.Params.commentOnAllPosts (ne .Params.comment false) }}
{{ partial "disqus.html" . }} {{ if eq .Site.Params.comment "disqus"}}
{{ end }} {{ partial "disqus.html" . }}
{{ end }}
{{ if and .Params.comment (eq .Site.Params.comment "ovo")}} {{ if eq .Site.Params.comment "ovo"}}
{{ partial "ovo.html" . }} {{ partial "ovo.html" . }}
{{ end }} {{ end }}
{{ if and .Params.comment (eq .Site.Params.comment "utterances")}} {{ if eq .Site.Params.comment "utterances"}}
{{ partial "utterances.html" . }} {{ partial "utterances.html" . }}
{{ end }}
{{ end }} {{ end }}
{{ end }} {{ end }}