From 1970ef43b0566581245963ae9c77763210fc87fa Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Sat, 16 Jun 2012 17:56:45 -0500 Subject: [PATCH] updated theme --- source/_includes/asides/googleplus.html | 11 -------- source/_includes/custom/asides/about.html | 4 --- source/_includes/head.html | 2 +- .../sidebars/blog_index_default.html | 4 +++ source/_includes/sidebars/page_default.html | 5 ++++ source/_includes/sidebars/post_default.html | 5 ++++ .../sections}/delicious.html | 0 .../{asides => sidebars/sections}/github.html | 0 .../sidebars/sections/google_plus.html | 6 +++++ .../sections}/pinboard.html | 0 .../sections}/recent_posts.html | 0 .../sections}/twitter.html | 0 source/_layouts/page.html | 12 ++++----- source/_layouts/post.html | 12 ++++----- source/index.html | 12 +++++---- source/javascripts/octopress.js | 27 ++++++++++++++++++- 16 files changed, 66 insertions(+), 34 deletions(-) delete mode 100644 source/_includes/asides/googleplus.html delete mode 100644 source/_includes/custom/asides/about.html create mode 100644 source/_includes/sidebars/blog_index_default.html create mode 100644 source/_includes/sidebars/page_default.html create mode 100644 source/_includes/sidebars/post_default.html rename source/_includes/{asides => sidebars/sections}/delicious.html (100%) rename source/_includes/{asides => sidebars/sections}/github.html (100%) create mode 100644 source/_includes/sidebars/sections/google_plus.html rename source/_includes/{asides => sidebars/sections}/pinboard.html (100%) rename source/_includes/{asides => sidebars/sections}/recent_posts.html (100%) rename source/_includes/{asides => sidebars/sections}/twitter.html (100%) diff --git a/source/_includes/asides/googleplus.html b/source/_includes/asides/googleplus.html deleted file mode 100644 index 00a0aa8..0000000 --- a/source/_includes/asides/googleplus.html +++ /dev/null @@ -1,11 +0,0 @@ -{% if site.googleplus_user %} -
-

- - - Google+ - -

-
-{% endif %} - diff --git a/source/_includes/custom/asides/about.html b/source/_includes/custom/asides/about.html deleted file mode 100644 index 59d309e..0000000 --- a/source/_includes/custom/asides/about.html +++ /dev/null @@ -1,4 +0,0 @@ -
-

About Me

-

A little something about me.

-
diff --git a/source/_includes/head.html b/source/_includes/head.html index 9482d18..2ed44e4 100644 --- a/source/_includes/head.html +++ b/source/_includes/head.html @@ -17,7 +17,7 @@ - {% capture canonical %}{{ site.url }}{% if site.permalink contains '.html' %}{{ page.url }}{% else %}{{ page.url | remove:'index.html' | strip_slash }}{% endif %}{% endcapture %} + {% capture canonical %}{{ site.url }}{% if site.permalink contains '.html' %}{{ page.url }}{% else %}{{ page.url | remove:'index.html' }}{% endif %}{% endcapture %} diff --git a/source/_includes/sidebars/blog_index_default.html b/source/_includes/sidebars/blog_index_default.html new file mode 100644 index 0000000..8e90a22 --- /dev/null +++ b/source/_includes/sidebars/blog_index_default.html @@ -0,0 +1,4 @@ +{% include sidebars/sections/twitter.html %} +{% include sidebars/sections/delicious.html %} +{% include sidebars/sections/pinboard.html %} +{% include sidebars/sections/google_plus.html %} diff --git a/source/_includes/sidebars/page_default.html b/source/_includes/sidebars/page_default.html new file mode 100644 index 0000000..1d91fc8 --- /dev/null +++ b/source/_includes/sidebars/page_default.html @@ -0,0 +1,5 @@ +{% include sidebars/sections/recent_posts.html %} +{% include sidebars/sections/twitter.html %} +{% include sidebars/sections/delicious.html %} +{% include sidebars/sections/pinboard.html %} +{% include sidebars/sections/google_plus.html %} diff --git a/source/_includes/sidebars/post_default.html b/source/_includes/sidebars/post_default.html new file mode 100644 index 0000000..1d91fc8 --- /dev/null +++ b/source/_includes/sidebars/post_default.html @@ -0,0 +1,5 @@ +{% include sidebars/sections/recent_posts.html %} +{% include sidebars/sections/twitter.html %} +{% include sidebars/sections/delicious.html %} +{% include sidebars/sections/pinboard.html %} +{% include sidebars/sections/google_plus.html %} diff --git a/source/_includes/asides/delicious.html b/source/_includes/sidebars/sections/delicious.html similarity index 100% rename from source/_includes/asides/delicious.html rename to source/_includes/sidebars/sections/delicious.html diff --git a/source/_includes/asides/github.html b/source/_includes/sidebars/sections/github.html similarity index 100% rename from source/_includes/asides/github.html rename to source/_includes/sidebars/sections/github.html diff --git a/source/_includes/sidebars/sections/google_plus.html b/source/_includes/sidebars/sections/google_plus.html new file mode 100644 index 0000000..57d3e00 --- /dev/null +++ b/source/_includes/sidebars/sections/google_plus.html @@ -0,0 +1,6 @@ +{% if site.google_plus_user %} + + Google Plus icon + +{% endif %} + diff --git a/source/_includes/asides/pinboard.html b/source/_includes/sidebars/sections/pinboard.html similarity index 100% rename from source/_includes/asides/pinboard.html rename to source/_includes/sidebars/sections/pinboard.html diff --git a/source/_includes/asides/recent_posts.html b/source/_includes/sidebars/sections/recent_posts.html similarity index 100% rename from source/_includes/asides/recent_posts.html rename to source/_includes/sidebars/sections/recent_posts.html diff --git a/source/_includes/asides/twitter.html b/source/_includes/sidebars/sections/twitter.html similarity index 100% rename from source/_includes/asides/twitter.html rename to source/_includes/sidebars/sections/twitter.html diff --git a/source/_layouts/page.html b/source/_layouts/page.html index 2837a98..1e7802e 100644 --- a/source/_layouts/page.html +++ b/source/_layouts/page.html @@ -23,12 +23,12 @@ layout: default {% include custom/after_page.html %} {% if page.comments == true %}{% include comments.html %}{% endif %} -{% unless page.sidebar == false %} +{% unless page.sidebar == false or site.default_sidebar == false %} {% endunless %} diff --git a/source/_layouts/post.html b/source/_layouts/post.html index a440b29..d58b043 100644 --- a/source/_layouts/post.html +++ b/source/_layouts/post.html @@ -28,12 +28,12 @@ single: true {% include custom/after_post.html %} {% if page.comments == true %}{% include comments.html %}{% endif %} -{% unless page.sidebar == false %} +{% unless page.sidebar == false or site.default_sidebar == false %} {% endunless %} diff --git a/source/index.html b/source/index.html index d201912..96cf416 100644 --- a/source/index.html +++ b/source/index.html @@ -19,10 +19,12 @@ layout: default {% endif %} +{% unless page.sidebar == false or site.default_sidebar == false %} +{% endunless %} diff --git a/source/javascripts/octopress.js b/source/javascripts/octopress.js index cbe2bcc..74d33dc 100644 --- a/source/javascripts/octopress.js +++ b/source/javascripts/octopress.js @@ -38,6 +38,7 @@ var octopress = (function(){ } if (sections.length >= 3){ $('aside.sidebar').addClass('thirds'); } } + , addCodeLineNumbers: function () { if (navigator.appName === 'Microsoft Internet Explorer') { return; } $('div.gist-highlight').each(function(index) { @@ -208,11 +209,21 @@ var octopress = (function(){ })() , github: (function(){ + + htmlEscape = function (str) { + return String(str) + .replace(/&/g, '&') + .replace(/"/g, '"') + .replace(/'/g, ''') + .replace(//g, '>'); + } + function render(target, data){ var i = 0, repos = ''; for(i = 0; i < data.length; i++) { - repos += '
  • '+data[i].name+'

    '+data[i].description+'

  • '; + repos += '
  • '+htmlEscape(data[i].name)+'

    '+htmlEscape(data[i].description)+'

  • '; } target.html(repos); } @@ -264,6 +275,20 @@ $(document).ready(function() { octopress.github.showRepos('#gh_repos'); }); +var htmlEncode = (function() { + var entities = { + '&' : '&' + , '<' : '<' + , '"' : '"' + }; + + return function(value) { + return value.replace(/[&<"]/g, function(c) { + return entities[c]; + }); + }; +})(); + // iOS scaling bug fix // Rewritten version // By @mathias, @cheeaun and @jdalton