Stacey Baker
Stacey Baker

Reputation: 229

Can't get Disqus commenting to work on Github Page Blog

I'm trying to add comments to my github page blog, and nothing happens when I add the code. No matter where I paste it. I've tried three different approaches so far:

  1. Per the JB installation documentation, I specified "disqus" as the provider and added my disqus short_name in my _config.yml file. That actually should have done it because the Jekyll Bootstrap ships with the JS widget that disqus provides when you sign up for an account. It's in the includes folder.

  2. Since that didn't work, I found the widget and added an include statement to my post.html template referencing it. This also didn't work.

  3. Since none of that worked (and I still insist I shouldn't have to paste the JS since it's already included with JB, but I was desperate at this point), I pasted the JS that disqus provided when I signed up for my account in the post.html in layouts and includes - I did this one at a time, testing each time I pasted.

Each time I did this, my page didn't change at all. It was like I did nothing.

I've googled this to death, and looked at the source of another github page that's successfully using disqus - the only thing that looked different is that he has his JS pasted into a layout.html page - I don't have one of those. I only have post & page. And I'm definitely trying to add comments to my posts, not my pages.

Upvotes: 2

Views: 1713

Answers (4)

yam
yam

Reputation: 1463

I had the same problem. Make sure you have the url parameter in your _config.yml set correctly:

url: "https://GITHUBUSERNAME.github.io"

Also it goes without saying but wouldn't hurt to make sure to that your short name parameter is also correct:

disqus:
    shortname: your-short-name

Upvotes: 1

gc5
gc5

Reputation: 9868

Maybe you just need to create a site profile here.

Hope this helps.

Upvotes: 0

smholloway
smholloway

Reputation: 587

I had similar issues because my site was using HTTPS and Disqus was being served over HTTP.

I could jekyll serve and see the comments locally, but the comments did not show up on the live site. After a bit of searching and diffing I opened the Chrome Web Inspector and saw a series of errors like the two examples below:

[blocked] The page at https://devblog.toopher.com/2013/07/05/enabling-travis-ci-for-fun-and-profit/ ran insecure content from http://toopherdevblog.disqus.com/embed.js.

The page at https://devblog.toopher.com/2013/07/05/enabling-travis-ci-for-fun-and-profit/ displayed insecure content from https://i.sstatic.net/POLl6.png.

I edited the Disqus comment provider (_includes/JB/comments-providers/disqus) and changed the Disqus URL to https:// like this:

dsq.src = 'https://' + disqus_shortname + '.disqus.com/embed.js';

Hope that helps someone else!

Upvotes: 4

Konarak
Konarak

Reputation: 283

First, let me tell you that I have worked with jekyll but I do not have any experience with jekyll bootstrap.

Second, after looking at your repo on github I think adding {% include JB/comments-providers/disqus %} to your post.html layout should solve the problem. This will load the javascript in your jekyll posts and thus enable comments, of course, after editing the _config.yml.

Upvotes: 1

Related Questions