Simplify if condition, and format code

This commit is contained in:
Jimmy Cai 2021-08-15 16:53:12 +00:00 committed by GitHub
parent c7dd876bb1
commit 0b3ff067d9

View File

@ -1,8 +1,8 @@
<div class="disqus-container">
{{- $pc := .Site.Config.Privacy.Disqus -}}
{{- $disqusjs := .Site.Params.Comments.Disqusjs -}}
{{- if not $pc.Disable -}}
{{ if and $disqusjs.Shortname $disqusjs.ApiKey }}<div id="disqus_thread"></div>
{{- if and (not $pc.Disable) (and $disqusjs.Shortname $disqusjs.ApiKey) -}}
<div id="disqus_thread"></div>
<script type="application/javascript">
var disqusjs;
function loadDisqusJS() {
@ -53,6 +53,5 @@
}
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
{{end}}
{{- end -}}
</div>