You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
1.0 KiB

1 year ago
  1. <% if (theme.disqus_enabled && theme.disqus_shortname){ %>
  2. <hr>
  3. <section id="comments" class="mt-2 mb-3">
  4. <div id="disqus_thread">
  5. <a href="#" class="button button-primary" onclick="loadDisqus();return false;">View / Make Comments</a>
  6. </div>
  7. <script>
  8. var disqus_config = function() {
  9. this.page.url = '<%= config.url + '/' + page.canonical_path %>';
  10. this.page.identifier = '<%= page.id || page.canonical_path %>';
  11. this.page.title = '<%= page.title %>';
  12. };
  13. var is_disqus_loaded = false;
  14. function loadDisqus() {
  15. if (!is_disqus_loaded) {
  16. is_disqus_loaded = true;
  17. var d = document,
  18. s = d.createElement('script');
  19. s.src = 'https://<%= theme.disqus_shortname %>.disqus.com/embed.js';
  20. s.setAttribute('data-timestamp', +new Date());
  21. (d.head || d.body).appendChild(s);
  22. }
  23. }
  24. </script>
  25. <noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
  26. </section>
  27. <% } %>