Skip to content

Commit 35cf3b7

Browse files
committed
restructure
1 parent 6b69e65 commit 35cf3b7

File tree

1 file changed

+31
-30
lines changed

1 file changed

+31
-30
lines changed

theme/toc.html

+31-30
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,18 @@
11
{# loop through all navigation items #}
2-
{# if the current item has children #}
3-
{% if nav_item.children %}
4-
{# if the current item title does not start with _ #}
5-
{% if not nav_item.title.startswith("_") %}
2+
3+
{# if the current item title does not start with _ #}
4+
{% if not nav_item.title.startswith("_") %}
5+
{# if the current item has children #}
6+
{% if nav_item.children %}
67
<ul class="subnav">
78
<li><span>{{ nav_item.title }}</span></li>
9+
{# output children #}
810
{% for nav_item in nav_item.children %}
911
{% include 'toc.html' %}
1012
{% endfor %}
1113
</ul>
12-
{# if current page title is _Tools #}
13-
{% elif nav_item.title == "_Tools" %}
14-
{% if current_page and current_page.title == "Tools" %}
15-
<ul class="subnav">
16-
{% for nav_item in nav_item.children %}
17-
{% include 'toc.html' %}
18-
{% endfor %}
19-
</ul>
20-
{% else %}
21-
{% if current_page and current_page.ancestors %}
22-
{% for doc in current_page.ancestors %}
23-
{% if nav_item.title == doc.title %}
24-
<ul class="subnav">
25-
{% for nav_item in nav_item.children %}
26-
{% include 'toc.html' %}
27-
{% endfor %}
28-
</ul>
29-
{% endif %}
30-
{% endfor %}
31-
{% endif %}
32-
{% endif %}
33-
{% endif %}
34-
{# if the current item does not have children #}
35-
{% else %}
36-
{# if the current item title does not start with _ #}
37-
{% if not nav_item.title.startswith("_") %}
14+
{# if the current item does not have children #}
15+
{% else %}
3816
<li class="toctree-l1
3917
{# if current item is active #}
4018
{% if nav_item.active %}current{% endif %}
@@ -61,3 +39,26 @@
6139
</li>
6240
{% endif %}
6341
{% endif %}
42+
43+
{# if current page title is _Tools #}
44+
{% if nav_item.title == "_Tools" %}
45+
{% if current_page and current_page.title == "Tools" %}
46+
<ul class="subnav">
47+
{% for nav_item in nav_item.children %}
48+
{% include 'toc.html' %}
49+
{% endfor %}
50+
</ul>
51+
{% else %}
52+
{% if current_page and current_page.ancestors %}
53+
{% for doc in current_page.ancestors %}
54+
{% if nav_item.title == doc.title %}
55+
<ul class="subnav">
56+
{% for nav_item in nav_item.children %}
57+
{% include 'toc.html' %}
58+
{% endfor %}
59+
</ul>
60+
{% endif %}
61+
{% endfor %}
62+
{% endif %}
63+
{% endif %}
64+
{% endif %}

0 commit comments

Comments
 (0)