Browse Source

add disqus comments to article page

pull/1/head
Brett Langdon 12 years ago
parent
commit
f2cb3d1351
2 changed files with 22 additions and 3 deletions
  1. +4
    -3
      templates/article.jade
  2. +18
    -0
      templates/mixins/disqus.jade

+ 4
- 3
templates/article.jade View File

@ -1,4 +1,4 @@
include mixins/disqus
extends layout extends layout
block append vars block append vars
@ -18,8 +18,9 @@ block content
article.article article.article
section.content!= typogr(page.html).typogrify() section.content!= typogr(page.html).typogrify()
section.comments
+disqus
block prepend footer block prepend footer
div.nav div.nav
a(href=contents.index.url) « Full blog a(href=contents.index.url) « Full blog

+ 18
- 0
templates/mixins/disqus.jade View File

@ -0,0 +1,18 @@
mixin disqus
#disqus_thread
script(type="text/javascript").
var disqus_shortname = 'brettlangdon';
var disqus_identifier = '#{page.title}';
var disqus_title = '#{page.title}';
var disqus_url = "http://brett.is#{page.url}";
(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);
})();
noscript
| Please enable JavaScript to view the
a(href="http://disqus.com/?ref_noscript")=" comments powered by Disqus."
a(href="http://disqus.com").dsq-brlink
| comments powered by
span.logo-disqus=" Disqus"

Loading…
Cancel
Save