mirror of
https://github.com/snachodog/just-the-docs.git
synced 2025-04-17 00:22:24 -06:00
Update nav.html for handling nav_exclude
It appears nav_exclude only works on top level navigation items. I needed it to work at the child level as well. I believe these changes accomplish that for the child and grand_child levels. Love this theme. I've used it a few times. Apologies if this pull request is not according to convention. This is the first time I've done it on someone else's code. Thanks!
This commit is contained in:
parent
8bd2da55fe
commit
6f2065aa57
@ -13,22 +13,26 @@
|
|||||||
{%- assign children_list = site.html_pages | where: "parent", node.title | sort:"nav_order" -%}
|
{%- assign children_list = site.html_pages | where: "parent", node.title | sort:"nav_order" -%}
|
||||||
<ul class="navigation-list-child-list ">
|
<ul class="navigation-list-child-list ">
|
||||||
{%- for child in children_list -%}
|
{%- for child in children_list -%}
|
||||||
<li class="navigation-list-item {% if page.url == child.url or page.parent == child.title %} active{% endif %}">
|
{%- unless child.nav_exclude -%}
|
||||||
{%- if page.url == child.url or page.parent == child.title -%}
|
<li class="navigation-list-item {% if page.url == child.url or page.parent == child.title %} active{% endif %}">
|
||||||
{%- assign second_level_url = child.url | absolute_url -%}
|
{%- if page.url == child.url or page.parent == child.title -%}
|
||||||
{%- endif -%}
|
{%- assign second_level_url = child.url | absolute_url -%}
|
||||||
<a href="{{ child.url | absolute_url }}" class="navigation-list-link{% if page.url == child.url %} active{% endif %}">{{ child.title }}</a>
|
{%- endif -%}
|
||||||
{%- if child.has_children -%}
|
<a href="{{ child.url | absolute_url }}" class="navigation-list-link{% if page.url == child.url %} active{% endif %}">{{ child.title }}</a>
|
||||||
{%- assign grand_children_list = site.html_pages | where: "parent", child.title | sort:"nav_order" -%}
|
{%- if child.has_children -%}
|
||||||
<ul class="navigation-list-child-list">
|
{%- assign grand_children_list = site.html_pages | where: "parent", child.title | sort:"nav_order" -%}
|
||||||
{%- for grand_child in grand_children_list -%}
|
<ul class="navigation-list-child-list">
|
||||||
<li class="navigation-list-item {% if page.url == grand_child.url %} active{% endif %}">
|
{%- for grand_child in grand_children_list -%}
|
||||||
<a href="{{ grand_child.url | absolute_url }}" class="navigation-list-link{% if page.url == grand_child.url %} active{% endif %}">{{ grand_child.title }}</a>
|
{%- unless grand_child.nav_exclude -%}
|
||||||
</li>
|
<li class="navigation-list-item {% if page.url == grand_child.url %} active{% endif %}">
|
||||||
{%- endfor -%}
|
<a href="{{ grand_child.url | absolute_url }}" class="navigation-list-link{% if page.url == grand_child.url %} active{% endif %}">{{ grand_child.title }}</a>
|
||||||
</ul>
|
</li>
|
||||||
{%- endif -%}
|
{%- endunless -%}
|
||||||
</li>
|
{%- endfor -%}
|
||||||
|
</ul>
|
||||||
|
{%- endif -%}
|
||||||
|
</li>
|
||||||
|
{%- endunless -%}
|
||||||
{%- endfor -%}
|
{%- endfor -%}
|
||||||
</ul>
|
</ul>
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user