fix: just include Disqus comment count JS once if enabled

Fix #1229
Fix a1ba678e79
This commit is contained in:
George Cushen committed 2019-07-27 21:19:27 +01:00
1 parent e24de2a2ca
commit dc2c70ecec
2 files changed
+6 -1

No files matched your search

-1
View File
@@ -54,7 +54,6 @@
{{ 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>
<script id="dsq-count-scr" src="https://{{site.Params.comments.disqus.shortname}}.disqus.com/count.js" async></script>
{{ end}}
{{ $taxonomy := "categories" }}
+6
View File
@@ -124,6 +124,12 @@
</script>
{{ 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_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. */}}