diff options
author | DSRKafuU | 2020-06-04 07:21:13 -0500 |
---|---|---|
committer | GitHub | 2020-06-04 07:21:13 -0500 |
commit | 73244a2e55dffa158027126346eefd5bafa5fea8 (patch) | |
tree | c98ee9fbdb6f474579aa769a2a4b0b4c98fd21f1 /layouts/partials/comment-disqus.html | |
parent | aa5290aeef9df1c583fdf30290351968df9215dc (diff) | |
parent | 914bf54c493b299268c293be33a8babf99b1cce2 (diff) | |
download | hugo-theme-fuji-73244a2e55dffa158027126346eefd5bafa5fea8.tar.gz hugo-theme-fuji-73244a2e55dffa158027126346eefd5bafa5fea8.tar.bz2 hugo-theme-fuji-73244a2e55dffa158027126346eefd5bafa5fea8.zip |
Merge pull request #24 from amzrk2/dev
v2 pre-release
Diffstat (limited to 'layouts/partials/comment-disqus.html')
-rw-r--r-- | layouts/partials/comment-disqus.html | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/layouts/partials/comment-disqus.html b/layouts/partials/comment-disqus.html index 539f8c7..782e369 100644 --- a/layouts/partials/comment-disqus.html +++ b/layouts/partials/comment-disqus.html @@ -1,18 +1,21 @@ -{{ with .Site.Params.disqusShortname }} -<div class="post-comment"> - <div id="disqus_thread"></div> +<div class="post-comment" data-comment="disqus"> + <span class="post-comment-notloaded"> + <ion-icon name="chatbox-ellipses"></ion-icon> {{ i18n "postComment" }} + </span> + <div id="disqus_thread" style="display: none;"></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'; + function loadComment() { + var commentArea = document.querySelector('.post-comment'); + var disqus_config = function () { + this.page.url = '{{ .Permalink }}'; + this.page.identifier = '{{ .File.ContentBaseName }}'; + }; + var s = document.createElement('script'); + s.src = 'https://' + '{{ .Site.Params.disqusShortname }}' + '.disqus.com/embed.js'; s.setAttribute('data-timestamp', +new Date()); - (d.head || d.body).appendChild(s); - })(); + document.querySelector('#disqus_thread').removeAttribute('style'); + (document.body || document.head).appendChild(s); + document.querySelector('span.post-comment-notloaded').setAttribute('style', 'display: none;'); + } </script> -</div> -{{ end }}
\ No newline at end of file +</div>
\ No newline at end of file |