Skip to content

Instantly share code, notes, and snippets.

@danielauener
Last active January 3, 2016 00:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielauener/8386516 to your computer and use it in GitHub Desktop.
Save danielauener/8386516 to your computer and use it in GitHub Desktop.
Add disqus to a ghost theme with easy to use disqus settings in default.hbs
<!-- include this just before the </head> tag -->
<script type='text/javascript'>//<![CDATA[
var disqus = {
'activate' : true,
'shortname' : 'example'
};
//]]></script>
<!-- include this where you want to display the comments -->
<div id="disqus_thread" class="comments"></div>
<script type="text/javascript">//<![CDATA[
if ( disqus.activate ) {
var disqus_shortname = disqus.shortname;
var disqus_identifier = '{{id}}'; // use {{post.id}} outside the {{#post}} loop
/* * * DON'T EDIT BELOW THIS LINE * * */
(function () {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
}());
}
//]]></script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment