aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/_nav.html32
1 files changed, 20 insertions, 12 deletions
diff --git a/templates/_nav.html b/templates/_nav.html
index 92ed4c5..9b76c96 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 %}
@@ -38,7 +46,7 @@
{% macro navmenu(current) %}
{% if current.ancestors %}
- {% set hierarchy = current.ancestors | concat(with=current.relative_path) %}
+ {% set hierarchy = current.ancestors | slice(start=1) | concat(with=current.relative_path) %}
{% else %}
{% set hierarchy = [current.relative_path] %}
{% endif %}