From d99afca9ea2cecee09e980264f9a75c1918a593a Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Wed, 1 Jun 2022 16:55:07 +0200 Subject: [PATCH] No arrows for empty sections --- templates/_nav.html | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/templates/_nav.html b/templates/_nav.html index 92ed4c5..3eb6900 100644 --- a/templates/_nav.html +++ b/templates/_nav.html @@ -7,16 +7,24 @@ {% for s in sec.subsections %} {% set p = get_section(path=s) %}
- {% if p.path == current.path %} - {{ p.title }} - {% elif hierarchy is containing(s) %} - ⯆ {{ p.title }} + {% if p.subsections or p.pages %} + {% if p.path == current.path %} + {{ p.title }} + {% elif hierarchy is containing(s) %} + ⯆ {{ p.title }} + {% else %} + ⯈ {{ p.title }} + {% endif %} + {% if hierarchy is containing(s) or current.path == p.path %} + {% if level + 1 < maxlevel %} + {{ nav::navsection(hierarchy=hierarchy,level=level + 1,current=current) }} + {% endif %} + {% endif %} {% else %} - ⯈ {{ p.title }} - {% endif %} - {% if hierarchy is containing(s) or current.path == p.path %} - {% if level + 1 < maxlevel %} - {{ nav::navsection(hierarchy=hierarchy,level=level + 1,current=current) }} + {% if p.path == current.path %} + {{ p.title }} + {% else %} + {{ p.title }} {% endif %} {% endif %}
@@ -27,9 +35,9 @@ {% for p in sec.pages %}
{% if p.path == current.path %} -   {{ p.title }} + {{ p.title }} {% else %} -   {{ p.title }} + {{ p.title }} {% endif %}
{% endfor %}