From eade4fc0d50e333a905945237a05dd7aaa644026 Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Sun, 25 Sep 2011 21:30:55 -0500 Subject: [PATCH] now layouts or pages can specify "sidebar: collapse" in the yaml front matter for an always collapsed sidebar --- .themes/classic/source/_layouts/default.html | 2 +- .../classic/source/javascripts/octopress.js | 20 ++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.themes/classic/source/_layouts/default.html b/.themes/classic/source/_layouts/default.html index 17c4e66..0b1fc3a 100644 --- a/.themes/classic/source/_layouts/default.html +++ b/.themes/classic/source/_layouts/default.html @@ -1,6 +1,6 @@ {% capture root_url %}{{ site.root | strip_slash }}{% endcapture %} {% include head.html %} - +
{% include header.html %}
diff --git a/.themes/classic/source/javascripts/octopress.js b/.themes/classic/source/javascripts/octopress.js index 29df198..fc679f1 100644 --- a/.themes/classic/source/javascripts/octopress.js +++ b/.themes/classic/source/javascripts/octopress.js @@ -11,15 +11,17 @@ function getNav() { } function addSidebarToggler() { - $('#content').append(''); - $('.toggle-sidebar').bind('click', function(e) { - e.preventDefault(); - if ($('body').hasClass('collapse-sidebar')) { - $('body').removeClass('collapse-sidebar'); - } else { - $('body').addClass('collapse-sidebar'); - } - }); + if(!$('body').hasClass('sidebar-footer')) { + $('#content').append(''); + $('.toggle-sidebar').bind('click', function(e) { + e.preventDefault(); + if ($('body').hasClass('collapse-sidebar')) { + $('body').removeClass('collapse-sidebar'); + } else { + $('body').addClass('collapse-sidebar'); + } + }); + } var sections = $('aside.sidebar > section'); if (sections.length > 1) { sections.each(function(section, index){