From 39052cdb1aefac942cae534becfbe4f3184c757d Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Wed, 10 Aug 2011 18:19:08 -0400 Subject: [PATCH] updated to latest site index system, added liquid tests for haml (hint, if you indent under a tag block, it breaks). added fix for twitter.js --- source/_includes/blog_index.html | 40 +++++++++++++++++++++++++++++ source/blog/index.html | 3 +++ source/index.html | 43 ++------------------------------ source/javascripts/twitter.js | 4 ++- source/test/haml/_partial.haml | 1 + source/test/haml/index.haml | 10 ++++++++ 6 files changed, 59 insertions(+), 42 deletions(-) create mode 100644 source/_includes/blog_index.html create mode 100644 source/blog/index.html create mode 100644 source/test/haml/_partial.haml create mode 100644 source/test/haml/index.haml diff --git a/source/_includes/blog_index.html b/source/_includes/blog_index.html new file mode 100644 index 0000000..c77ea7d --- /dev/null +++ b/source/_includes/blog_index.html @@ -0,0 +1,40 @@ +
+{% assign index = true %} +{% for post in paginator.posts %} +{% assign content = post.content %} +
+ {% include article.html %} +
+{% endfor %} + +{% if site.disqus_short_name %} + +{% endif %} +
+ diff --git a/source/blog/index.html b/source/blog/index.html new file mode 100644 index 0000000..0614c4f --- /dev/null +++ b/source/blog/index.html @@ -0,0 +1,3 @@ +--- +layout: blog_index +--- diff --git a/source/index.html b/source/index.html index 7f4c0e1..fa5310a 100644 --- a/source/index.html +++ b/source/index.html @@ -1,44 +1,5 @@ --- layout: default -footer: false --- -
-{% assign index = true %} -{% for post in paginator.posts %} -{% assign content = post.content %} -
- {% include article.html %} -
-{% endfor %} - -{% if site.disqus_short_name %} - -{% endif %} -
- + +{% include blog_index.html %} diff --git a/source/javascripts/twitter.js b/source/javascripts/twitter.js index 676619e..1f1b2f9 100644 --- a/source/javascripts/twitter.js +++ b/source/javascripts/twitter.js @@ -1,13 +1,15 @@ // JSON-P Twitter fetcher for Octopress // (c) Brandon Mathis // MIT Lisence function getTwitterFeed(user, count, replies) { - feed = new jXHR(); + var feed = new jXHR(); + feed.onerror = function (msg,url) { $('#tweets li.loading').addClass('error').text("Twitter's busted"); } feed.onreadystatechange = function(data){ if (feed.readyState === 4) { var tweets = new Array(); + var i = 0; for (i in data){ if(tweets.length < count){ if(replies || data[i].in_reply_to_user_id == null){ diff --git a/source/test/haml/_partial.haml b/source/test/haml/_partial.haml new file mode 100644 index 0000000..ccf284e --- /dev/null +++ b/source/test/haml/_partial.haml @@ -0,0 +1 @@ +%p will it work? {% img /images/logo.png %} diff --git a/source/test/haml/index.haml b/source/test/haml/index.haml new file mode 100644 index 0000000..85e780f --- /dev/null +++ b/source/test/haml/index.haml @@ -0,0 +1,10 @@ +--- +layout: page +title: "Haml" +date: 2011-08-02 11:48 +comments: true +sharing: true +footer: true +--- + +{% render_partial test/haml/_partial.haml %}