Browse Source

refactor: use Hugo's cascade system for commentable

BREAKING CHANGE: remove commentable from params.yaml
George Cushen 3 years ago
parent
commit
61ce4e59a3

+ 1 - 3
wowchemy/layouts/partials/comments.html

@@ -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
wowchemy/layouts/partials/page_metadata.html

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