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

github.com/zwbetz-gh/cayman-hugo-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzwbetz <zwbetz@gmail.com>2019-04-02 21:15:26 +0300
committerzwbetz <zwbetz@gmail.com>2019-04-02 21:15:26 +0300
commit51469b0fd3ef7904dcdae0bda768ae98341d1ff4 (patch)
treea3fe06e3a7df297c5b6b5953c9d016c2bf1e0f13 /layouts
parent1b3150721691737b4ddd2aaa84571f1498eb5157 (diff)
Don't show disqus comments if shortname has not been changed
Diffstat (limited to 'layouts')
-rw-r--r--layouts/partials/disqus.html6
-rw-r--r--layouts/post/single.html10
2 files changed, 11 insertions, 5 deletions
diff --git a/layouts/partials/disqus.html b/layouts/partials/disqus.html
new file mode 100644
index 0000000..e6f4d11
--- /dev/null
+++ b/layouts/partials/disqus.html
@@ -0,0 +1,6 @@
+{{ $ctx := . }}
+{{ with $.Site.DisqusShortname }}
+ {{ if ne . "yourdiscussshortname" }}
+ {{ template "_internal/disqus.html" $ctx }}
+ {{ end }}
+{{ end }}
diff --git a/layouts/post/single.html b/layouts/post/single.html
index 4b7dc57..be81dff 100644
--- a/layouts/post/single.html
+++ b/layouts/post/single.html
@@ -4,18 +4,18 @@
{{ $dateFormat := $.Site.Params.dateFormat | default "Jan 2, 2006" }}
<strong>Publish date: </strong>{{ .PublishDate.Format $dateFormat }}
</div>
+ {{ $tags := slice }}
{{ with .Params.tags }}
<div>
<strong>Tags: </strong>
{{ range . }}
{{ $href := print ("tags/" | absLangURL) (. | urlize) "/" }}
- <a href="{{ $href }}">{{ . }}</a>
+ {{ $element := printf "<a href=\"%s\">%s</a>" $href . }}
+ {{ $tags = $tags | append $element }}
{{ end }}
+ {{ delimit $tags ", " }}
</div>
{{ end }}
{{ .Content }}
- {{ $ctx := . }}
- {{ with $.Site.DisqusShortname }}
- {{ template "_internal/disqus.html" $ctx }}
- {{ end }}
+ {{ partial "disqus.html" . }}
{{ end }}