Use Twig pages function for navigation

See 681ad27158 for more info
master
Daniel Rudolf 6 years ago
parent 470a734034
commit 138a88e05f
No known key found for this signature in database
GPG Key ID: A061F02CD8DE4538
  1. 5
      index.twig

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

Loading…
Cancel
Save