diff --git a/README.md b/README.md index 2f03d976..aec4fa11 100644 --- a/README.md +++ b/README.md @@ -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 = "" diff --git a/layouts/partials/paige/comments.html b/layouts/partials/paige/comments.html index c16f67b2..dff6a419 100644 --- a/layouts/partials/paige/comments.html +++ b/layouts/partials/paige/comments.html @@ -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 }}