mirror of
https://github.com/gcushen/hugo-academic.git
synced 2025-07-26 19:15:16 +02: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:
parent
f759efccf7
commit
fa8e64327e
2 changed files with 6 additions and 2 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue