summaryrefslogtreecommitdiffstats
path: root/layouts/partials/comment-disqus.html
diff options
context:
space:
mode:
authoramzrk22020-06-03 13:58:49 +0800
committeramzrk22020-06-03 13:58:49 +0800
commit3df71601ae866aff9c2ae060ed1ac7407807fcc4 (patch)
treead34004b865f43aecf43d111b5586f592a1e05ba /layouts/partials/comment-disqus.html
parente6afd04368f56af57b77f71be4dda5a4d9279a64 (diff)
downloadhugo-theme-fuji-3df71601ae866aff9c2ae060ed1ac7407807fcc4.tar.gz
hugo-theme-fuji-3df71601ae866aff9c2ae060ed1ac7407807fcc4.tar.bz2
hugo-theme-fuji-3df71601ae866aff9c2ae060ed1ac7407807fcc4.zip
New comment area & opt out of font awesome
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 75b3f4c..909c0ed 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;查看评论
+ </span>
+ <div id="disqus_thread" style="display: none;"></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';
+ 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