gohugoio / hugo

The world’s fastest framework for building websites.
https://gohugo.io
Apache License 2.0
75.88k stars 7.54k forks source link

Disqus Comment Count #3074

Closed tvb closed 7 years ago

tvb commented 7 years ago

Hi,

I am trying to update my gohugo page with a comments counter. This is my actual disqus code:

<div id="disqus_thread"></div>
<script type="text/javascript">

(function() {
if (window.location.hostname == "localhost")
return;

var disqus_config = function () {
this.page.url = '{{ .URL }}';
this.page.identifier = '{{ .UniqueID }}';
this.page.title = '{{ .Title }}';
};

var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
var disqus_shortname = '{{ .Site.DisqusShortname }}';
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the comments.</noscript>

My comments link:

<li>
<a href="{{ .URL }}#disqus_thread" class="disqus-comment-count" data-disqus-identifier="{{ .UniqueID }}"><i class="icon-comments"> Comments</a>
</li>

And just before the closing body tag:

<script id="dsq-count-scr" src="//storecore.disqus.com/count.js" async=""></script> 
</body>

However. The comments link is never updated to include the actual amount of comments.

What am I doing wrong?

bep commented 7 years ago

Please use http://discuss.gohugo.io/ for questions/troubleshooting. Also see Hugo Documentation.

github-actions[bot] commented 2 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.