Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/vividvilla/ezhil.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVivek R <vividvilla@gmail.com>2019-12-30 17:06:27 +0300
committerVivek R <vividvilla@gmail.com>2019-12-30 17:09:09 +0300
commit76678b55595595bc9313f78ae4290d1e3ae568d5 (patch)
tree03e76b04c45cb339ee1a2fb15bb301a596e00ca5 /layouts
parent972d3cef5457c04f3901a7faff92e42a900a2061 (diff)
fix: disable disqus if Site.DisqusShortname is not set
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/single.html8
1 files changed, 7 insertions, 1 deletions
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 2283e9a..4138ac7 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -27,19 +27,25 @@
{{ end }}
{{ end }}
</div>
-
{{- $.Scratch.Set "isDisqus" true -}}
+ <!-- Disable if content type is excluded in config -->
{{- if and (isset .Params "type") (in .Site.Params.disableDisqusTypes .Params.type) -}}
{{- $.Scratch.Set "isDisqus" false -}}
{{- end -}}
+ <!-- Check if content has flag to enable/disable disqus explicitly -->
{{- if and (isset .Params "disqus") (eq .Params.disqus false) -}}
{{- $.Scratch.Set "isDisqus" false -}}
{{- else if and (isset .Params "disqus") (eq .Params.disqus true) -}}
{{- $.Scratch.Set "isDisqus" true -}}
{{- end -}}
+ <!-- Check if disqus short name is given -->
+ {{ if not .Site.DisqusShortname }}
+ {{- $.Scratch.Set "isDisqus" false -}}
+ {{ end }}
+
{{- if eq ($.Scratch.Get "isDisqus") true -}}
{{- partial "disqus.html" . -}}
{{- end -}}