diff options
Diffstat (limited to 'layouts/partials/comment.html')
-rw-r--r-- | layouts/partials/comment.html | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/layouts/partials/comment.html b/layouts/partials/comment.html new file mode 100644 index 0000000..c9c4bb1 --- /dev/null +++ b/layouts/partials/comment.html @@ -0,0 +1,23 @@ +<section class="comment"> + <p class="local-info"> + Comment is disabled to avoid unwanted discussions from 'localhost:1313' on your Disqus + account... + </p> + <div id="disqus_thread"></div> +</section> +<script type="text/javascript"> + + (function () { + if (window.location.hostname == "localhost") { + return + } + document.querySelector('.local-info').classList.add('hide') + + let dsq = document.createElement('script') + dsq.type = 'text/javascript' + dsq.async = true + let disqus_shortname = '{{ .Site.DisqusShortname }}' + dsq.src = 'https://' + disqus_shortname + '.disqus.com/embed.js'; + (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq) + })() +</script> |