Skip to content

Commit

Permalink
Further improvements to allow sidebar to be on either side
Browse files Browse the repository at this point in the history
Also fix for when page.sidebar not set - should default to true in
my opinion - but could have a site.sidebar_default if need be.
  • Loading branch information
willthames committed Sep 17, 2012
1 parent 230118f commit 1adf6c9
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
4 changes: 2 additions & 2 deletions source/_includes/sidebar.html
@@ -1,5 +1,5 @@
{% unless page.sidebar == false %}
<div class="span4 sidebar">
<div class="span{{ site.sidebar_width or 4 }} sidebar">
<div class="well">
{% if site.page_asides.size %}
{% include_array page_asides %}
Expand All @@ -8,4 +8,4 @@
{% endif %}
</div>
</div>
{% endunless %}
{% endunless %}
9 changes: 7 additions & 2 deletions source/_layouts/page.html
Expand Up @@ -3,6 +3,9 @@
---

<div class="row">
{% if page.sidebar and site.sidebar_posn == "left" %}
{% include sidebar.html %}
{% endif %}
<div class="{% if page.sidebar == false %}span12{% else %}span8{% endif %}">
{% if page.title %}
<div class="page-header">
Expand Down Expand Up @@ -33,5 +36,7 @@ <h1>Comments</h1>
</section>
{% endif %}
</div>
{% include sidebar.html %}
</div>
{% if page.sidebar and site.sidebar_posn != "left" %}
{% include sidebar.html %}
{% endif %}
</div>
14 changes: 10 additions & 4 deletions source/_layouts/post.html
@@ -1,10 +1,14 @@
---
layout: default
single: true
# page.sidebar is not necessarily set for pages - assume true if not set
---

<div class="row">
<div class="{% if page.sidebar == false %}span12{% else %}span8{% endif %}">
{% if page.sidebar != false and site.sidebar_posn == "left" %}
{% include sidebar.html %}
{% endif %}
<div class="{% if page.sidebar != false %}span8{% else %}span12{% endif %}">
{% include article.html %}
<footer>
<p class="meta">
Expand All @@ -17,10 +21,10 @@
{% endunless %}
<p class="meta">
{% if page.previous.url %}
<a class="basic-alignment left" href="{{page.previous.url}}" title="Previous Post: {{page.previous.title}}">&laquo; {{page.previous.title}}</a>
<a class="basic-alignment pull-left" href="{{page.previous.url}}" title="Previous Post: {{page.previous.title}}">&laquo; {{page.previous.title}}</a>
{% endif %}
{% if page.next.url %}
<a class="basic-alignment right" href="{{page.next.url}}" title="Next Post: {{page.next.title}}">{{page.next.title}} &raquo;</a>
<a class="basic-alignment pull-right" href="{{page.next.url}}" title="Next Post: {{page.next.title}}">{{page.next.title}} &raquo;</a>
{% endif %}
</p>
</footer>
Expand All @@ -33,6 +37,8 @@ <h1>Comments</h1>
{% endif %}
</div>

{% include sidebar.html %}
{% if page.sidebar != false and site.sidebar_posn != "left" %}
{% include sidebar.html %}
{% endif %}
</div>

0 comments on commit 1adf6c9

Please sign in to comment.