aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB Mathis <brandon@imathis.com>2009-11-05 22:36:37 -0600
committerB Mathis <brandon@imathis.com>2009-11-05 22:36:37 -0600
commit416667ccaaa5244af76ecea91a20edff9ec77586 (patch)
tree653ae60920f1439d8a02d9ffe67e5a2a86f2acc9
parent6c9f1567ce4a4ac29d33f20533618b462285a4f2 (diff)
downloadmy_new_personal_website-416667ccaaa5244af76ecea91a20edff9ec77586.tar.xz
my_new_personal_website-416667ccaaa5244af76ecea91a20edff9ec77586.zip
added disqus comment support
-rw-r--r--Rakefile2
-rw-r--r--source/_layouts/default.haml22
-rw-r--r--source/index.haml5
3 files changed, 27 insertions, 2 deletions
diff --git a/Rakefile b/Rakefile
index 236a5c03..af65af0d 100644
--- a/Rakefile
+++ b/Rakefile
@@ -47,7 +47,7 @@ task :generate_style do
end
desc "Generate site files only"
-task :generate_site => :clean do
+task :generate_site => [:clean, :generate_style] do
puts ">>> Generating site files <<<"
system "jekyll"
system "mv #{site}/atom.html #{site}/atom.xml"
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 &copy; #{Time.now.strftime('%Y')} - #{page.blog_title} | "
%span.credit Powered by <a href="http://github.com/imathis/octopress/">Octopress</a>
-
+ //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('<script charset="utf-8" type="text/javascript" src="http://disqus.com/forums/#{page.disqus_site}/get_num_replies.js' + query + '"></' + 'script>');
+ })();
//Google Analytics code
:javascript
try {
diff --git a/source/index.haml b/source/index.haml
index a244f7e0..78662684 100644
--- a/source/index.haml
+++ b/source/index.haml
@@ -7,5 +7,10 @@ title: Blog
.article
%h2= link_to(post.title, post.url, {:class=>"title"})
= post.content
+ .footer
+ - if post.data["comments_off"]
+ %em.comments_off Comments disabled
+ - else
+ %a(href="#{post.url}/#disqus_thread")Comments
.footer
%a(href="/archives.html" title="archives") &laquo; Blog Archives \ No newline at end of file