mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-18 22:12:45 +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 }}
|
{{ errorf "The '%s' comment provider was not found." $provider }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ $commentable_page_types := site.Params.comments.commentable | default dict }}
|
{{ $commentable_page := .Params.commentable }}
|
||||||
{{ $commentable_page_type := index $commentable_page_types .Type | default false }}
|
|
||||||
{{ $commentable_page := (ne .Params.commentable false) | and $commentable_page_type }}
|
|
||||||
|
|
||||||
{{ if $commentable_page }}
|
{{ if $commentable_page }}
|
||||||
<section id="comments">
|
<section id="comments">
|
||||||
|
|||||||
@@ -47,9 +47,7 @@
|
|||||||
|
|
||||||
{{/* Show Disqus comment count if enabled. */}}
|
{{/* Show Disqus comment count if enabled. */}}
|
||||||
{{ $comments_provider := trim (site.Params.comments.provider | lower) " " }}
|
{{ $comments_provider := trim (site.Params.comments.provider | lower) " " }}
|
||||||
{{ $commentable_page_types := site.Params.comments.commentable | default dict }}
|
{{ $commentable_page := $page.Params.commentable }}
|
||||||
{{ $commentable_page_type := index $commentable_page_types $page.Type | default false }}
|
|
||||||
{{ $commentable_page := (ne $page.Params.commentable false) | and $commentable_page_type }}
|
|
||||||
{{ if (eq $comments_provider "disqus") | and (site.Params.comments.disqus.show_count | default true) | and $commentable_page }}
|
{{ if (eq $comments_provider "disqus") | and (site.Params.comments.disqus.show_count | default true) | and $commentable_page }}
|
||||||
<span class="middot-divider"></span>
|
<span class="middot-divider"></span>
|
||||||
<a href="{{ $page.RelPermalink }}#disqus_thread"><!-- Count will be inserted here --></a>
|
<a href="{{ $page.RelPermalink }}#disqus_thread"><!-- Count will be inserted here --></a>
|
||||||
|
|||||||
Reference in new issue
Block a user