Add paige.comments.disable_kinds config

master
Will Faught 12 months ago
parent 1fca28b8a7
commit 342da4cce9

@ -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 }}

Loading…
Cancel
Save