From 416667ccaaa5244af76ecea91a20edff9ec77586 Mon Sep 17 00:00:00 2001 From: B Mathis Date: Thu, 5 Nov 2009 22:36:37 -0600 Subject: added disqus comment support --- source/_layouts/default.haml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'source/_layouts') diff --git a/source/_layouts/default.haml b/source/_layouts/default.haml index 30f4da19..0ab168d3 100644 --- a/source/_layouts/default.haml +++ b/source/_layouts/default.haml @@ -1,6 +1,8 @@ --- blog_title: My Octopress Blog +full_url: google_site_search_id: +disqus_site: designenthusiast --- !!! 1.1 Transitional @@ -45,6 +47,13 @@ google_site_search_id: %p.pubdate Published: =page.date.strftime("%d %b, %Y") + #disqus_thread + :javascript + var disqus_developer = true; + var disqus_url = "#{page.full_url}/#{page.url}"; + %noscript + %a(href="http://designenthusiast.disqus.com/?url=ref") View the discussion thread + %script(type="text/javascript" src="http://disqus.com/forums/#{page.disqus_site}/embed.js") - else = content #sidebar @@ -55,7 +64,18 @@ google_site_search_id: .page_width = "Copyright © #{Time.now.strftime('%Y')} - #{page.blog_title} | " %span.credit Powered by Octopress - + //Disqus Commens code + :javascript + (function() { + var links = document.getElementsByTagName('a'); + var query = '?'; + for(var i = 0; i < links.length; i++) { + if(links[i].href.indexOf('#disqus_thread') >= 0) { + query += 'url' + i + '=' + encodeURIComponent(links[i].href) + '&'; + } + } + document.write('