summaryrefslogtreecommitdiffstats
path: root/layouts/partials/comment-disqusjs.html
blob: ebede31f3e6b29b27cf15d4f5374caab996eec88 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<div class="post-comment" data-comment="disqus">
    <span class="post-comment-notloaded">
        <ion-icon name="chatbox-ellipses"></ion-icon>&nbsp;查看评论
    </span>
    <div id="disqus_thread" style="display: none;"></div>
    <script src="https://cdn.jsdelivr.net/npm/disqusjs@1.3/dist/disqus.js"></script>
    <script>
        function loadComment() {
            document.querySelector('#disqus_thread').removeAttribute('style');
            var dsqjs = new DisqusJS({
                shortname: '{{ .Site.Params.disqusShortname }}',
                siteName: '{{ .Site.Title }}',
                identifier: '{{ .File.ContentBaseName }}',
                url: '{{ .Permalink }}',
                title: '{{ .Title }}',
                api: '{{ .Site.Params.disqusJSApi }}',
                apikey: '{{ .Site.Params.disqusJSApikey }}'
            });
            document.querySelector('span.post-comment-notloaded').setAttribute('style', 'display: none;');
        }
    </script>
</div>