I’ve had a look at the config file for your website. Your disqusShortname has to be something like spf13 or digitalcraftsman instead of a URL. The disqus shortname is the handle or nickname that is usually displayed next to your comments.
Update: I fixed the issue, even though I am not 100% sure what the problem was. I ended up not using the Hugo template, but wrote my own partial which included a simpler version of the Disqus code injection. I have a hunch that the
var disqus_url =
is the culprit, because the template uses relative URLS, whereas I read on the Disqus forum that absolute URLs are needed.
Hello @felixthoemmes, exactly the same issue here while proof-testing Hugo with the bookshelf project of the “quick installation guide”. I checked again and all variables are correct on my side (both in Disqus and in my Hugo project).
I’m using Hugo Static Site Generator v0.20.7 darwin/amd64
Any chance to see the main code fixed? Any hint you can give me about modifying my theme ?
Hi @xaviermarchial, have a look at my github repos (link below). I think the template used relative URLs for the little disqus script, but absolute ones were needed. What I ended up doing was to change the templates of the theme to correct for that. Have a look at this:
I am using Hugo 0.24.1 at the moment and had problems with this. The documentation was not very clear to me about disqus. So I spend some hours debugging. Eventually I figured out that the problem is disqus_url being relative and not absolute.
Why does Hugo generate relative disqus URLs and not throw an error, if Disqus requires absolute URLs according to the Disqus documentation? An error message makes the user aware of the problem. I had to look in the output html an disqus documentation to understand the issue.
In my case the problem was also related to baseURL in config.toml. I fixed it by not specifying it config.toml, but adding a flag in my Gulpfile. I only learned more about baseURL configuration here and the behavior could also be explained better in the documentation.
It works for me now so this is just my feedback to make the experience better for the next person.