disqus.html 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. {{ $disqusShortName := site.DisqusShortname }}
  2. {{ if site.Params.features.comment.disqus.shortName }}
  3. {{ $disqusShortName = site.Params.features.comment.disqus.shortName }}
  4. {{ end }}
  5. <div id="disqus_thread"></div>
  6. <script type="text/javascript">
  7. (function () {
  8. // Don't ever inject Disqus on localhost--it creates unwanted
  9. // discussions from 'localhost:1313' on your Disqus account...
  10. if (window.location.hostname == "localhost") return;
  11. var dsq = document.createElement("script");
  12. dsq.type = "text/javascript";
  13. dsq.async = true;
  14. var disqus_shortname = "{{ $disqusShortName }}";
  15. dsq.src = "//" + disqus_shortname + ".disqus.com/embed.js";
  16. (
  17. document.getElementsByTagName("head")[0] ||
  18. document.getElementsByTagName("body")[0]
  19. ).appendChild(dsq);
  20. })();
  21. </script>
  22. <noscript
  23. >{{ i18n "comments_javascript" }}
  24. <a href="https://disqus.com/?ref_noscript"
  25. >{{ i18n "comments_by" }} Disqus.</a
  26. ></noscript
  27. >
  28. <a href="https://disqus.com/" class="dsq-brlink"
  29. >{{ i18n "comments_by" }} <span class="logo-disqus">Disqus</span></a
  30. >