summaryrefslogtreecommitdiffstats
path: root/layouts/partials/comment-disqus.html
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/partials/comment-disqus.html')
-rw-r--r--layouts/partials/comment-disqus.html33
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>&nbsp;{{ 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