aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-06-01 16:55:07 +0200
committerAlex Auvolat <alex@adnab.me>2022-06-01 16:55:07 +0200
commitd99afca9ea2cecee09e980264f9a75c1918a593a (patch)
tree778325e0ca3df120ebefd8bc268e5600951d8529
parent0900f2910e908ff8c997b684c2f7ae69791f50de (diff)
downloadguide.deuxfleurs.fr-d99afca9ea2cecee09e980264f9a75c1918a593a.tar.gz
guide.deuxfleurs.fr-d99afca9ea2cecee09e980264f9a75c1918a593a.zip
No arrows for empty sections
-rw-r--r--templates/_nav.html30
1 files 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) %}
<div class="toc-item">
- {% if p.path == current.path %}
- <a class="subtext" href="{{ p.permalink | safe}}">⯆ <b>{{ p.title }}</b></a>
- {% elif hierarchy is containing(s) %}
- <a class="subtext" href="{{ p.permalink | safe}}">⯆ {{ p.title }}</a>
+ {% if p.subsections or p.pages %}
+ {% if p.path == current.path %}
+ <a class="subtext" href="{{ p.permalink | safe}}">⯆ <b>{{ p.title }}</b></a>
+ {% elif hierarchy is containing(s) %}
+ <a class="subtext" href="{{ p.permalink | safe}}">⯆ {{ p.title }}</a>
+ {% else %}
+ <a class="subtext" href="{{ p.permalink | safe}}">⯈ {{ p.title }}</a>
+ {% 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 %}
- <a class="subtext" href="{{ p.permalink | safe}}">⯈ {{ p.title }}</a>
- {% 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 %}
+ <a class="subtext" href="{{p.permalink | safe}}"><b>{{ p.title }}</b></a>
+ {% else %}
+ <a class="subtext" href="{{p.permalink | safe}}">{{ p.title }}</a>
{% endif %}
{% endif %}
</div>
@@ -27,9 +35,9 @@
{% for p in sec.pages %}
<div class="toc-item">
{% if p.path == current.path %}
- <a class="subtext" href="{{p.permalink | safe}}">&nbsp;&nbsp;<b>{{ p.title }}</b></a>
+ <a class="subtext" href="{{p.permalink | safe}}"><b>{{ p.title }}</b></a>
{% else %}
- <a class="subtext" href="{{p.permalink | safe}}">&nbsp;&nbsp;{{ p.title }}</a>
+ <a class="subtext" href="{{p.permalink | safe}}">{{ p.title }}</a>
{% endif %}
</div>
{% endfor %}