mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-12 14:14:48 +00:00
refactor: use Hugo's cascade system for commentable
BREAKING CHANGE: remove commentable from params.yaml
This commit is contained in:
1 parent
439dfb3a40
commit
61ce4e59a3
2 files changed
+2
-6
No files matched your search
@@ -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">
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in new issue
Block a user