blob: 1d70b9fc11a87ccb850a96b017556f45a61ab26c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
<!-- Render sections -->
{% if nav_item.children %}
<li>
<span class="section">{{ nav_item.title }}</span>
<ul>
<!-- Render pages of section -->
{% for nav_item in nav_item.children %}
{% include "nav.html" %}
{% endfor %}
</ul>
</li>
<!-- Render page link -->
{% else %}
<li>
<a class="{% if nav_item.active %}current{% endif %}"
title="{{ nav_item.title }}" href="{{ nav_item.url }}" >
{{ nav_item.title }}
</a>
<!-- Expand active pages -->
{% if nav_item == current_page %}
<!--
The top-level anchor must be skipped if the article contains a h1
headline, since it would be redundant to the link to the current page
that is located just above the anchor. Therefore we directly continue
with the children of the anchor.
-->
{% if h1 %}
{% set toc = (toc | first).children %}
{% endif %}
<!-- Render anchors of active page -->
{% if toc and (toc | first) %}
<ul>
{% for toc_item in toc %}
<!-- Render anchor -->
<li class="anchor">
<a title="{{ toc_item.title }}" href="{{ toc_item.url }}">
{{ toc_item.title }}
</a>
</li>
{% endfor %}
</ul>
{% endif %}
{% endif %}
</li>
{% endif %}
|