Add paige.comments.disable_kinds config
This commit is contained in:
@@ -244,6 +244,7 @@ account_id = ""
|
||||
|
||||
[paige.comments]
|
||||
disable = false # Disable all comments
|
||||
disable_kinds = [] # Page kinds to disable comments for. Examples: ["list"], ["page", "term"].
|
||||
|
||||
[paige.comments.cactus] # See https://cactus.chat
|
||||
account_id = ""
|
||||
|
@@ -1,6 +1,12 @@
|
||||
{{ $page := . }}
|
||||
|
||||
{{ if $page.Param "paige.comments.disable" | not }}
|
||||
{{ $disable := $page.Param "paige.comments.disable" }}
|
||||
{{ $disablekinds := $page.Param "paige.comments.disable_kinds" }}
|
||||
|
||||
{{ $enabled := $disable | not }}
|
||||
{{ $enabledkind := or (not $disablekinds) (not (in $disablekinds $page.Kind)) }}
|
||||
|
||||
{{ if and $enabled $enabledkind }}
|
||||
{{ template "_internal/disqus.html" $page }}
|
||||
{{ partial "paige/comments/cactus.html" $page }}
|
||||
{{ partial "paige/comments/commento.html" $page }}
|
||||
|
Reference in New Issue
Block a user