summaryrefslogtreecommitdiffstats
path: root/layouts
diff options
context:
space:
mode:
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/single.html3
-rw-r--r--layouts/partials/comment-disqus.html16
2 files changed, 19 insertions, 0 deletions
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 6bfce19..78a9148 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -24,6 +24,9 @@
{{ if .Site.Params.cdnUtterancesJS }}
{{ partial "comment-utterances.html" . }}
{{ end }}
+ {{ if .Site.Params.disqusShortname }}
+ {{ partial "comment-disqus.html" . }}
+ {{ end }}
</div>
<!-- sidebar -->
<div class="col-md-3 col-12 float-left" id="sidebar">
diff --git a/layouts/partials/comment-disqus.html b/layouts/partials/comment-disqus.html
new file mode 100644
index 0000000..4477226
--- /dev/null
+++ b/layouts/partials/comment-disqus.html
@@ -0,0 +1,16 @@
+<div id="post-comment">
+ <div id="disqus_thread"></div>
+ <script>
+ var disqus_config = function () {
+ this.page.url = "{{ .Permalink }}";
+ this.page.identifier = "{{ .RelPermalink }}";
+ };
+ (function () {
+ var d = document,
+ s = d.createElement('script');
+ s.src = 'https://{{ .Site.Params.disqusShortname }}.disqus.com/embed.js';
+ s.setAttribute('data-timestamp', +new Date());
+ (d.head || d.body).appendChild(s);
+ })();
+ </script>
+</div> \ No newline at end of file