Last active
December 10, 2015 04:58
-
-
Save jimmyhillis/4384337 to your computer and use it in GitHub Desktop.
Jade markup for integrating Disqus within a template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#disqus_thread | |
noscript Please enable JavaScript to view the | |
a(href='http://disqus.com/?ref_noscript') comments powered by Disqus | |
a(href="http://disqus.com", class="dsq-brlink") comments powered by | |
span(class="logo-disqus") Disqus | |
script | |
var disqus_shortname = 'shortname_here'; | |
(function() { | |
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; | |
dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js'; | |
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I generally prefer to have the JavaScript outside of the markup (e.g. not inline) but this way makes it easier to add extra
disqus_
settings be set through your view variables, if you need that.