mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-13 10:15:22 +00:00
fix: don't require site.Params.comments
Enable `comments` to be removed from `params.toml` for a site that doesn't use comments
This commit is contained in:
1 parent
f759efccf7
commit
fa8e64327e
2 files changed
+6
-2
No files matched your search
@@ -1,4 +1,6 @@
|
||||
{{ if site.Params.comments.engine | and (index site.Params.comments.commentable .Type) | and (ne .Params.commentable false) | or .Params.commentable }}
|
||||
{{ $commentable_map := site.Params.comments.commentable | default dict }}
|
||||
{{ $commentable_bool := index $commentable_map .Type | default false }}
|
||||
{{ if site.Params.comments.engine | and $commentable_bool | and (ne .Params.commentable false) | or .Params.commentable }}
|
||||
<section id="comments">
|
||||
{{ if eq site.Params.comments.engine 1 }}
|
||||
{{ partial "comments/disqus.html" . }}
|
||||
|
||||
@@ -46,7 +46,9 @@
|
||||
{{ end }}
|
||||
|
||||
{{/* Show Disqus comment count if enabled. */}}
|
||||
{{ $disqus_enabled := eq site.Params.comments.engine 1 | and (index site.Params.comments.commentable $page.Type) | and (ne $page.Params.commentable false) | or $page.Params.commentable }}
|
||||
{{ $commentable_map := site.Params.comments.commentable | default dict }}
|
||||
{{ $commentable_bool := index $commentable_map $page.Type | default false }}
|
||||
{{ $disqus_enabled := eq site.Params.comments.engine 1 | and $commentable_bool | and (ne $page.Params.commentable false) | or $page.Params.commentable }}
|
||||
{{ if and $disqus_enabled (site.Params.comments.disqus.show_count | default true) }}
|
||||
<span class="middot-divider"></span>
|
||||
<a href="{{ $page.RelPermalink }}#disqus_thread"><!-- Count will be inserted here --></a>
|
||||
|
||||
Reference in new issue
Block a user