diff options
author | Brandon Mathis <brandon@imathis.com> | 2011-09-25 21:30:55 -0500 |
---|---|---|
committer | Brandon Mathis <brandon@imathis.com> | 2011-09-25 21:31:18 -0500 |
commit | eade4fc0d50e333a905945237a05dd7aaa644026 (patch) | |
tree | 160c4171e085abc5ada8efba91eabfd9858990ed | |
parent | c26e5c3be9ee717caae34a280ef5f38e98a1a322 (diff) | |
download | my_new_personal_website-eade4fc0d50e333a905945237a05dd7aaa644026.tar.xz my_new_personal_website-eade4fc0d50e333a905945237a05dd7aaa644026.zip |
now layouts or pages can specify "sidebar: collapse" in the yaml front matter for an always collapsed sidebar
-rw-r--r-- | .themes/classic/source/_layouts/default.html | 2 | ||||
-rw-r--r-- | .themes/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 17c4e664..0b1fc3a9 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 %} -<body {% if page.body_id %} id="{{ page.body_id }}" {% endif %} {% if page.sidebar == false %} class="no-sidebar" {% endif %}> +<body {% if page.body_id %} id="{{ page.body_id }}" {% endif %} {% if page.sidebar == false %} class="no-sidebar" {% endif %} {% if page.sidebar == 'collapse' %} class="collapse-sidebar sidebar-footer" {% endif %}> <header role="banner">{% include header.html %}</header> <nav role="navigation">{% include navigation.html %}</nav> <div id="main"> diff --git a/.themes/classic/source/javascripts/octopress.js b/.themes/classic/source/javascripts/octopress.js index 29df1981..fc679f11 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('<span class="toggle-sidebar"></span>'); - $('.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('<span class="toggle-sidebar"></span>'); + $('.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){ |