summaryrefslogtreecommitdiffstats
path: root/layouts/partials/comment-disqus.html
blob: 75b3f4c598983e48cd930cb091aad3625788214d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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 = {{ $.File.ContentBaseName }};
        };
        (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 }}