From eefe29e5d0b6caab2f6bfcab7a10dbf43e208ac3 Mon Sep 17 00:00:00 2001 From: B Mathis Date: Wed, 10 Mar 2010 12:23:30 -0600 Subject: now Octopress uses partials --- source/_helpers.rb | 5 +- source/_includes/config.haml | 17 ++++++ source/_includes/delicious.haml | 3 ++ source/_includes/disqus_hook.haml | 11 ++++ source/_includes/disqus_thread.haml | 5 ++ source/_includes/footer.haml | 7 +++ source/_includes/google_analytics.haml | 10 ++++ source/_includes/head.haml | 21 ++++++++ source/_includes/header.haml | 8 +++ source/_includes/navigation.haml | 8 +++ source/_includes/post.haml | 8 +++ source/_includes/sidebar.haml | 2 + source/_includes/twitter.haml | 4 ++ source/_layouts/blog_post.haml | 32 +++++++++++ source/_layouts/default.haml | 97 +++------------------------------- source/index.haml | 16 +++--- 16 files changed, 156 insertions(+), 98 deletions(-) create mode 100644 source/_includes/config.haml create mode 100644 source/_includes/delicious.haml create mode 100644 source/_includes/disqus_hook.haml create mode 100644 source/_includes/disqus_thread.haml create mode 100644 source/_includes/footer.haml create mode 100644 source/_includes/google_analytics.haml create mode 100644 source/_includes/head.haml create mode 100644 source/_includes/header.haml create mode 100644 source/_includes/navigation.haml create mode 100644 source/_includes/post.haml create mode 100644 source/_includes/sidebar.haml create mode 100644 source/_includes/twitter.haml create mode 100644 source/_layouts/blog_post.haml (limited to 'source') diff --git a/source/_helpers.rb b/source/_helpers.rb index b1714569..11d78523 100644 --- a/source/_helpers.rb +++ b/source/_helpers.rb @@ -111,8 +111,6 @@ module Helpers end include TagHelper - # My added helpers - def to_html_email(address) email = string_to_html(address) "#{email}" @@ -165,7 +163,7 @@ module Helpers # A very hackish way to handle partials. We'll go with it till it breaks... def include(partial_name) file_ext = partial_name[(partial_name.index('.') + 1)..partial_name.length] - contents = IO.read("_includes/#{partial_name}") + contents = IO.read("source/_includes/#{partial_name}") case file_ext when 'haml' Haml::Engine.new(contents).render(binding) @@ -180,6 +178,7 @@ module Helpers end include PartialsHelper + end class String diff --git a/source/_includes/config.haml b/source/_includes/config.haml new file mode 100644 index 00000000..7ac49a85 --- /dev/null +++ b/source/_includes/config.haml @@ -0,0 +1,17 @@ +--- +blog_title: My Octopress Blog + +twitter_user: +tweet_count: 3 +show_replies: false + +delicious_user: +delicious_count: 3 + +full_url: +disqus_short_name: + +google_custom_search_id: +google_analytics_tracking_id: + +--- \ No newline at end of file diff --git a/source/_includes/delicious.haml b/source/_includes/delicious.haml new file mode 100644 index 00000000..6f1d63d0 --- /dev/null +++ b/source/_includes/delicious.haml @@ -0,0 +1,3 @@ +%h4 My Delicious more → +#delicious + %script(type="text/javascript" src="http://feeds.delicious.com/v2/js/#{page.delicious_user}?title=&count=#{page.delicious_count}&sort=date&extended") \ No newline at end of file diff --git a/source/_includes/disqus_hook.haml b/source/_includes/disqus_hook.haml new file mode 100644 index 00000000..60e2d3d9 --- /dev/null +++ b/source/_includes/disqus_hook.haml @@ -0,0 +1,11 @@ +: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('