mirror of
https://github.com/snachodog/just-the-docs.git
synced 2025-04-22 02:52:23 -06:00
Hides dispay of grandchildren
Display of grandchildren links in the navigation is now delayed until their parent is selected. To test, select the `Grandchildren test` node. Only the direct children should appear. Selecting one of them then shows its children.
This commit is contained in:
parent
8bd2da55fe
commit
94c1dc3736
@ -10,6 +10,7 @@
|
|||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
<a href="{{ node.url | absolute_url }}" class="navigation-list-link{% if page.url == node.url %} active{% endif %}">{{ node.title }}</a>
|
<a href="{{ node.url | absolute_url }}" class="navigation-list-link{% if page.url == node.url %} active{% endif %}">{{ node.title }}</a>
|
||||||
{%- if node.has_children -%}
|
{%- if node.has_children -%}
|
||||||
|
{%- if page.url == node.url or page.parent == node.title or page.grand_parent == node.title -%}
|
||||||
{%- 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 -%}
|
||||||
@ -19,6 +20,7 @@
|
|||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
<a href="{{ child.url | absolute_url }}" class="navigation-list-link{% if page.url == child.url %} active{% endif %}">{{ child.title }}</a>
|
<a href="{{ child.url | absolute_url }}" class="navigation-list-link{% if page.url == child.url %} active{% endif %}">{{ child.title }}</a>
|
||||||
{%- if child.has_children -%}
|
{%- if child.has_children -%}
|
||||||
|
{%- if page.url == child.url or page.parent == child.title -%}
|
||||||
{%- assign grand_children_list = site.html_pages | where: "parent", child.title | sort:"nav_order" -%}
|
{%- assign grand_children_list = site.html_pages | where: "parent", child.title | sort:"nav_order" -%}
|
||||||
<ul class="navigation-list-child-list">
|
<ul class="navigation-list-child-list">
|
||||||
{%- for grand_child in grand_children_list -%}
|
{%- for grand_child in grand_children_list -%}
|
||||||
@ -28,10 +30,12 @@
|
|||||||
{%- endfor -%}
|
{%- endfor -%}
|
||||||
</ul>
|
</ul>
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
{%- endif -%}
|
||||||
</li>
|
</li>
|
||||||
{%- endfor -%}
|
{%- endfor -%}
|
||||||
</ul>
|
</ul>
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
{%- endif -%}
|
||||||
</li>
|
</li>
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
{%- endunless -%}
|
{%- endunless -%}
|
||||||
|
11
docs/grandchildren-test/buttons.md
Normal file
11
docs/grandchildren-test/buttons.md
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
layout: default
|
||||||
|
title: Buttons
|
||||||
|
parent: Grandchildren test
|
||||||
|
has_children: true
|
||||||
|
---
|
||||||
|
|
||||||
|
Buttons
|
||||||
|
----
|
||||||
|
|
||||||
|
Child of [Grandchildren test](..)
|
9
docs/grandchildren-test/buttons/grandchild.md
Normal file
9
docs/grandchildren-test/buttons/grandchild.md
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
layout: default
|
||||||
|
title: Buttons Child Page
|
||||||
|
parent: Buttons
|
||||||
|
grand_parent: Grandchildren test
|
||||||
|
---
|
||||||
|
|
||||||
|
Buttons Child Page
|
||||||
|
----
|
12
docs/grandchildren-test/index.md
Normal file
12
docs/grandchildren-test/index.md
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
layout: default
|
||||||
|
title: Grandchildren test
|
||||||
|
has_children: true
|
||||||
|
nav_order: 8
|
||||||
|
---
|
||||||
|
|
||||||
|
Grandchildren test
|
||||||
|
==================
|
||||||
|
|
||||||
|
Has a child [Buttons](buttons)
|
||||||
|
and a grandchild [Child of Buttons](buttons/grandchild)
|
11
docs/grandchildren-test/labels.md
Normal file
11
docs/grandchildren-test/labels.md
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
layout: default
|
||||||
|
title: Labels
|
||||||
|
parent: Grandchildren test
|
||||||
|
has_children: true
|
||||||
|
---
|
||||||
|
|
||||||
|
Labels
|
||||||
|
----
|
||||||
|
|
||||||
|
Child of Grandchildren test
|
9
docs/grandchildren-test/labels/label-grandchild.md
Normal file
9
docs/grandchildren-test/labels/label-grandchild.md
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
layout: default
|
||||||
|
title: Labels Child Page
|
||||||
|
parent: Labels
|
||||||
|
grand_parent: Grandchildren test
|
||||||
|
---
|
||||||
|
|
||||||
|
Labels Child Page
|
||||||
|
----
|
Loading…
x
Reference in New Issue
Block a user