mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-13 10:15:22 +00:00
fix: just include Disqus comment count JS once if enabled
Fix #1229
Fix a1ba678e79
This commit is contained in:
1 parent
e24de2a2ca
commit
dc2c70ecec
2 files changed
+6
-1
No files matched your search
@@ -54,7 +54,6 @@
|
|||||||
{{ if and $disqus_enabled (site.Params.comments.disqus.show_count | default true) }}
|
{{ if and $disqus_enabled (site.Params.comments.disqus.show_count | default true) }}
|
||||||
<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>
|
||||||
<script id="dsq-count-scr" src="https://{{site.Params.comments.disqus.shortname}}.disqus.com/count.js" async></script>
|
|
||||||
{{ end}}
|
{{ end}}
|
||||||
|
|
||||||
{{ $taxonomy := "categories" }}
|
{{ $taxonomy := "categories" }}
|
||||||
|
|||||||
@@ -124,6 +124,12 @@
|
|||||||
</script>
|
</script>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
{{/* Disqus Comment Count JS. */}}
|
||||||
|
{{ $disqus_enabled := eq site.Params.comments.engine 1 | and (index site.Params.comments.commentable .Type) | and (ne .Params.commentable false) | or .Params.commentable }}
|
||||||
|
{{ if and $disqus_enabled (site.Params.comments.disqus.show_count | default true) }}
|
||||||
|
<script id="dsq-count-scr" src="https://{{site.Params.comments.disqus.shortname}}.disqus.com/count.js" async></script>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
{{ $js_comment := printf "/* Source Themes Academic v%s | https://sourcethemes.com/academic/ */\n" site.Data.academic.version }}
|
{{ $js_comment := printf "/* Source Themes Academic v%s | https://sourcethemes.com/academic/ */\n" site.Data.academic.version }}
|
||||||
{{ $js_bundle_head := $js_comment | resources.FromString "js/bundle-head.js" }}
|
{{ $js_bundle_head := $js_comment | resources.FromString "js/bundle-head.js" }}
|
||||||
{{ $js_linebreak := "\n" | resources.FromString "js/linebreak.js" }}{{/* Fix no line break after Bootstrap JS causing error. */}}
|
{{ $js_linebreak := "\n" | resources.FromString "js/linebreak.js" }}{{/* Fix no line break after Bootstrap JS causing error. */}}
|
||||||
|
|||||||
Reference in new issue
Block a user