RRC|BIOSTATISTICS

Troubleshooting Octopress - Disqus Comments Not Visible

Crikey, Disqus was difficult to configure. I had to go all-out Sherlock on that nonsense to finally get the comments to load.

What is supposed  to happen

Log into Disqus, set your Site Url:, Site Name:, and Site Shortname: under the General – Settings tab. Great! Now configure your _config.yml by entering your Disqus shortname after disqus_short_name: Then your Disqus comments load!

Except they don’t.

Below is the list of the extra details you need to triple check when you get the error message “Disqus Comments Not Visible” and help.disqus.com isn’t doing you any good.

Are you registered?

After you sign up with Disqus, you will get a confirmation email from them to establish validity of your email. Your comments may not be loading because you haven’t confirmed it yet.

Is your domain trustworthy?

Under {Disqus Shortname}.disqus.com, go to the “Settings” tab. Under Advanced, or {Disqus Shortname}.disqus.com/admin/settings/advanced/ enter your server’s domain. Not the name of your blog, but the source name. For example, mine is hal.case.edu

Is your URL correctly listed?

Disqus throws a royal hissy fit about excess forward slashes. This was actually the real reason why my Disqus wasn’t loading. Go to the General settings tab while you’re signed in in Disqus (also known as: `{Disqus Shortname}.disqus.com/admin/settings/general/). The most important thing to look for is your Website URL. Make sure there is no trailing forward slash at the end. Otherwise Disqus will oh-so-helpfully add a double slash to your comment path, rendering the Javascript unable to locate your blog page. The image shows my corrected sitename, from hal.case.edu/~rrc/ to hal.case.edu/~rrc



Is your _config.yml set up correctly?

Your _config file in Octopress is also another oportunity for one of those game-ending forward slashes. You can check for yourself what is happening if you look at the Page Source of your blog page. To do this, right-click on your blog page, select “View Page Source”. Then look for the following HTML at the way bottom of your Octopress-generated page:

1
2
3
4
5
6
7
8
9
10
11
12
<script type="text/javascript">
var disqus_shortname = 'rcbiostat';
// var disqus_developer = 1;
var disqus_identifier = 'hal.case.edu/~rrc//blog/2013/09/27/zsh/';
var disqus_url = 'hal.case.edu/~rrc//blog/2013/09/27/zsh/';
var disqus_script = 'embed.js';
(function () {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'http://' + disqus_shortname + '.disqus.com/' + disqus_script;
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
}());
</script>

See the problem? Something is generating an extra forward slash in your var disqus_url and var disqus_identifier You can check this yourself within your Octopress folder by viewing source/_includes/disqus.html and examine the code that is generating this javascript:

1
2
3
4
5
...
var disqus_identifier = 'http://hal.case.edu/~rrc/blog/2013/09/29/disqus-comments-not-visible/';
var disqus_url = 'http://hal.case.edu/~rrc/blog/2013/09/29/disqus-comments-not-visible/';
var disqus_script = 'embed.js';
...

This problem is coming from your _config.yml file. To fix it, go to cd octopress Then enter emacs _config.yml

Look for the url: of your _config.yml file. Its right at the top under “Main Configs”. Change it from sitename.com/ to sitename.com Another place to look is your “Jekyll & Plugins” section and see what your root: lists your website as. Is there a trailing “/” there? Try leaving that blank.

Then rake generate; rake deploy and your Disqus comments should really, truely, surely load.

Comments