summaryrefslogtreecommitdiffstats
path: root/layouts/partials/comment-disqus.html
diff options
context:
space:
mode:
authoramzrk22020-05-29 16:55:27 +0800
committeramzrk22020-05-29 16:55:27 +0800
commit594655b050145b7c3beab06166678940e613a79a (patch)
tree23184d72fb68b3bcb146536a425a3a571ae1367a /layouts/partials/comment-disqus.html
parentd47a131ca03b813b26345c752d41cc8999a646ce (diff)
downloadhugo-theme-fuji-594655b050145b7c3beab06166678940e613a79a.tar.gz
hugo-theme-fuji-594655b050145b7c3beab06166678940e613a79a.tar.bz2
hugo-theme-fuji-594655b050145b7c3beab06166678940e613a79a.zip
Disqus support
Diffstat (limited to 'layouts/partials/comment-disqus.html')
-rw-r--r--layouts/partials/comment-disqus.html18
1 files changed, 18 insertions, 0 deletions
diff --git a/layouts/partials/comment-disqus.html b/layouts/partials/comment-disqus.html
new file mode 100644
index 0000000..539f8c7
--- /dev/null
+++ b/layouts/partials/comment-disqus.html
@@ -0,0 +1,18 @@
+{{ with .Site.Params.disqusShortname }}
+<div class="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://{{ . }}.disqus.com/embed.js';
+ s.setAttribute('data-timestamp', +new Date());
+ (d.head || d.body).appendChild(s);
+ })();
+ </script>
+</div>
+{{ end }} \ No newline at end of file