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

github.com/zwbetz-gh/cupper-hugo-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZachary Betz <zwbetz@gmail.com>2019-03-05 23:59:47 +0300
committerZachary Betz <zwbetz@gmail.com>2019-03-06 20:01:16 +0300
commit58913dcd56c199567bff009b943c26e5bd9d3fca (patch)
tree805758f66ece24d3afc39b12362f9a4984c4c3ca /layouts
parent67ba0083853d6af93e77e39f5085f04aef9c8356 (diff)
Add disqus comments
Diffstat (limited to 'layouts')
-rw-r--r--layouts/partials/disqus.html13
-rw-r--r--layouts/post/single.html2
2 files changed, 14 insertions, 1 deletions
diff --git a/layouts/partials/disqus.html b/layouts/partials/disqus.html
new file mode 100644
index 0000000..19305cc
--- /dev/null
+++ b/layouts/partials/disqus.html
@@ -0,0 +1,13 @@
+<div id="disqus-container">
+ {{ $ctx := . }}
+ {{ with .Site.DisqusShortname }}
+ <button id="disqus-button" onclick="showComments()">Show comments</button>
+ <div id="disqus-comments">
+ {{ if eq . "yourdiscussshortname" }}
+ <p>Disqus comments are disabled.</p>
+ {{ else }}
+ {{ template "_internal/disqus.html" $ctx }}
+ {{ end }}
+ </div>
+ {{ end }}
+</div>
diff --git a/layouts/post/single.html b/layouts/post/single.html
index 5b409be..3374cf4 100644
--- a/layouts/post/single.html
+++ b/layouts/post/single.html
@@ -26,10 +26,10 @@
</ul>
</div>
{{ end }}
-
{{ if ne .Params.toc false }}
{{ partial "toc" . }}
{{ end }}
{{ .Content }}
</main>
+ {{ partial "disqus.html" . }}
{{ end }}