diff --git a/layouts/partials/disqus-js-common.js b/layouts/partials/disqus-js-common.js new file mode 100644 index 0000000..e709807 --- /dev/null +++ b/layouts/partials/disqus-js-common.js @@ -0,0 +1,6 @@ +// Remove button +var disqusButton = document.getElementById('disqus-button'); +disqusButton.remove(); +// Un-hide comments +var disqusComments = document.getElementById('disqus-comments'); +disqusComments.style.display = 'block'; \ No newline at end of file diff --git a/layouts/partials/disqus-js-main.js b/layouts/partials/disqus-js-main.js new file mode 100644 index 0000000..74bff17 --- /dev/null +++ b/layouts/partials/disqus-js-main.js @@ -0,0 +1,10 @@ +// Config +var disqus_config = function () { +}; +// Build and append comments +var d = document; +var s = d.createElement('script'); +s.async = true; +s.src = '//' + "{{ . }}" + '.disqus.com/embed.js'; +s.setAttribute('data-timestamp', + new Date()); +(d.head || d.body).appendChild(s); \ No newline at end of file diff --git a/layouts/partials/disqus.html b/layouts/partials/disqus.html index 19305cc..1105c91 100644 --- a/layouts/partials/disqus.html +++ b/layouts/partials/disqus.html @@ -1,13 +1,27 @@
Disqus comments are disabled.
+ {{ else }} - {{ template "_internal/disqus.html" $ctx }} +