refactor: use Hugo's cascade system for commentable

BREAKING CHANGE: remove commentable from params.yaml
This commit is contained in:
George Cushen committed 2022-01-19 21:01:09 +00:00
1 parent 439dfb3a40
commit 61ce4e59a3
2 files changed
+2 -6

No files matched your search

+1 -3
View File
@@ -7,9 +7,7 @@
{{ errorf "The '%s' comment provider was not found." $provider }}
{{ end }}
{{ $commentable_page_types := site.Params.comments.commentable | default dict }}
{{ $commentable_page_type := index $commentable_page_types .Type | default false }}
{{ $commentable_page := (ne .Params.commentable false) | and $commentable_page_type }}
{{ $commentable_page := .Params.commentable }}
{{ if $commentable_page }}
<section id="comments">
+1 -3
View File
@@ -47,9 +47,7 @@
{{/* Show Disqus comment count if enabled. */}}
{{ $comments_provider := trim (site.Params.comments.provider | lower) " " }}
{{ $commentable_page_types := site.Params.comments.commentable | default dict }}
{{ $commentable_page_type := index $commentable_page_types $page.Type | default false }}
{{ $commentable_page := (ne $page.Params.commentable false) | and $commentable_page_type }}
{{ $commentable_page := $page.Params.commentable }}
{{ if (eq $comments_provider "disqus") | and (site.Params.comments.disqus.show_count | default true) | and $commentable_page }}
<span class="middot-divider"></span>
<a href="{{ $page.RelPermalink }}#disqus_thread"><!-- Count will be inserted here --></a>