Skip to content

Commit

Permalink
Merge pull request #632 from askpatrickw/patch-1
Browse files Browse the repository at this point in the history
Gum: Honor conditional categories and pages
  • Loading branch information
justinmayer authored Jan 21, 2019
2 parents 4c135ac + 3fd6c5c commit 8e5e02d
Showing 1 changed file with 20 additions and 22 deletions.
42 changes: 20 additions & 22 deletions gum/templates/sidebar.html
Original file line number Diff line number Diff line change
@@ -1,32 +1,30 @@
<div class="three columns">

<h4>Pages</h4>

<ul>
{% for title, link in MENUITEMS %}
<li><a href="{{ link }}">{{ title }}</a></li>
{% endfor %}
{% if DISPLAY_PAGES_ON_MENU %}
<h4>Pages</h4>

<ul>
{% for title, link in MENUITEMS %}
<li><a href="{{ link }}">{{ title }}</a></li>
{% endfor %}

{% for p in pages %}
<li{% if p == page %} class="active"{% endif %}><a href="{{ SITEURL }}/{{ p.url }}">{{ p.title }}</a></li>
<li {% if p==page %} class="active" {% endif %}><a href="{{ SITEURL }}/{{ p.url }}">{{ p.title }}</a></li>
{% endfor %}
{% else %}
{% if DISPLAY_CATEGORIES_ON_MENU %}
{% for cat, null in categories %}
<li{% if cat == category %} class="active"{% endif %}><a href="{{ SITEURL }}/{{ cat.url }}">{{ cat }}</a></li>
{% endfor %}
{% endif %}
{% else %}
</ul>
{% endif %}

{% if DISPLAY_CATEGORIES_ON_MENU %}
{% if categories and categories|length > 1 %}
<h4>Categories</h4>
<ul class="blank">
{% for cat, null in categories %}
<li><a href="{{ SITEURL }}/{{ cat.url|e }}">{{ cat }}</a></li>
{% endfor %}
</ul>

{% if categories and categories|length > 1 %}
<h4>Categories</h4>
<ul class="blank">
{% for cat, null in categories %}
<li><a href="{{ SITEURL }}/{{ cat.url|e }}">{{ cat }}</a></li>
{% endfor %}
</ul>
{% endif %}
{% endif %}
{% endif %}


{% if tag_cloud %}
Expand Down

0 comments on commit 8e5e02d

Please sign in to comment.