Skip to content

Commit

Permalink
restructure
Browse files Browse the repository at this point in the history
  • Loading branch information
janpio committed Aug 1, 2018
1 parent 6b69e65 commit 35cf3b7
Showing 1 changed file with 31 additions and 30 deletions.
61 changes: 31 additions & 30 deletions theme/toc.html
Original file line number Diff line number Diff line change
@@ -1,40 +1,18 @@
{# loop through all navigation items #}
{# if the current item has children #}
{% if nav_item.children %}
{# if the current item title does not start with _ #}
{% if not nav_item.title.startswith("_") %}

{# if the current item title does not start with _ #}
{% if not nav_item.title.startswith("_") %}
{# if the current item has children #}
{% if nav_item.children %}
<ul class="subnav">
<li><span>{{ nav_item.title }}</span></li>
{# output children #}
{% for nav_item in nav_item.children %}
{% include 'toc.html' %}
{% endfor %}
</ul>
{# if current page title is _Tools #}
{% elif nav_item.title == "_Tools" %}
{% if current_page and current_page.title == "Tools" %}
<ul class="subnav">
{% for nav_item in nav_item.children %}
{% include 'toc.html' %}
{% endfor %}
</ul>
{% else %}
{% if current_page and current_page.ancestors %}
{% for doc in current_page.ancestors %}
{% if nav_item.title == doc.title %}
<ul class="subnav">
{% for nav_item in nav_item.children %}
{% include 'toc.html' %}
{% endfor %}
</ul>
{% endif %}
{% endfor %}
{% endif %}
{% endif %}
{% endif %}
{# if the current item does not have children #}
{% else %}
{# if the current item title does not start with _ #}
{% if not nav_item.title.startswith("_") %}
{# if the current item does not have children #}
{% else %}
<li class="toctree-l1
{# if current item is active #}
{% if nav_item.active %}current{% endif %}
Expand All @@ -61,3 +39,26 @@
</li>
{% endif %}
{% endif %}

{# if current page title is _Tools #}
{% if nav_item.title == "_Tools" %}
{% if current_page and current_page.title == "Tools" %}
<ul class="subnav">
{% for nav_item in nav_item.children %}
{% include 'toc.html' %}
{% endfor %}
</ul>
{% else %}
{% if current_page and current_page.ancestors %}
{% for doc in current_page.ancestors %}
{% if nav_item.title == doc.title %}
<ul class="subnav">
{% for nav_item in nav_item.children %}
{% include 'toc.html' %}
{% endfor %}
</ul>
{% endif %}
{% endfor %}
{% endif %}
{% endif %}
{% endif %}

0 comments on commit 35cf3b7

Please sign in to comment.