Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Inject Disqus comment script into Casper of Ghost blog. Append the following code in Settings -> Code Injection -> Blog Footer.
<script>
(function(disqusid) {
var d=document,sections=document.getElementsByTagName("section")
for(var i=0;i<sections.length;i++){
if(sections[i].className=='share'){
var div=d.createElement('div');
div.setAttribute('id','disqus_thread');
sections[i].parentNode.appendChild(div);
var s=d.createElement('script');
s.src='//'+disqusid+'.disqus.com/embed.js';
s.setAttribute('data-timestamp',+new Date());
(d.head || d.body).appendChild(s);
break
}
}
})("_DISQUS_SHORTNAME_HERE_")
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.