Default theme: Navigation: Show top-level pages only

This commit is contained in:
Daniel Rudolf 2016-12-06 19:36:52 +01:00
parent ea2146b2db
commit b712650678
No known key found for this signature in database
GPG key ID: A061F02CD8DE4538

View file

@ -29,9 +29,12 @@
<div id="nav" role="region" tabindex="-1">
<ul>
{% for page in pages if page.title %}
<li{% if page.id == current_page.id %} class="active"{% endif %}>
<a href="{{ page.url }}">{{ page.title }}</a>
</li>
{% set pageDepth = page.id|split('/')|length %}
{% if (pageDepth == 2) and (page.id ends with "/index") or (pageDepth == 1) %}
<li{% if page.id == current_page.id %} class="active"{% endif %}>
<a href="{{ page.url }}">{{ page.title }}</a>
</li>
{% endif %}
{% endfor %}
</ul>
</div>