Saturday, September 14, 2019

Disqus Complaining "Content Security Policy" Error on Jekyll Webite

I was building a website using Jekyll with the Minima theme. Following the instruction of the Minima theme, I set up Disqus to posts on the site by adding the "Disqus shortname" to Jekyll site configuration file _config.yml, such as,


disqus:
    shortname: mysite-short-name

However, the site displays an error message,

We were unable to load Disqus. If you are a moderator please see our troubleshooting guide.
When I clicked on the error message, Disqus shows an error message

Content Security Policy error
It turns out that to make Disqus work, we must include a url attribute in the configuration file, i.e., after I added the attribute, the configuration now includes,

url: https://mysite-url-used-for-disqus
disqus:
    shortname: mysite-short-name

No comments:

Post a Comment