From 0cfc0f0357a3b98997ddafe05f819537ffcd1980 Mon Sep 17 00:00:00 2001 From: Peter Mosses Date: Fri, 16 Aug 2019 13:32:24 +0200 Subject: [PATCH 1/7] Update nav.html A `navigation-list-child-list` is not displayed unless the enclosing `navigation-list-item` is `active`, so it needs to be generated only when `page.url == node.url or page.parent == node.title or page.grand_parent == node.title`. --- _includes/nav.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/_includes/nav.html b/_includes/nav.html index d561a42..1c1dd2b 100644 --- a/_includes/nav.html +++ b/_includes/nav.html @@ -10,6 +10,7 @@ {%- endif -%} {{ node.title }} {%- 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" -%} {%- endif -%} + {%- endif -%} {%- endif -%} {%- endunless -%} From 8ac545a5eb5da8e2ebe7dda1a8bffa9d94e88cc2 Mon Sep 17 00:00:00 2001 From: Peter Mosses Date: Wed, 21 Aug 2019 13:49:07 +0200 Subject: [PATCH 2/7] Optional delay of grandchildren link display The current default is that when a grandparent is selected, the links to its children *and all its grandchildren* are displayed in the navigation menu. Setting `grandchildren_branch: true` in `_config.yml` delays the display of links to grandchildren until their parent is selected. --- _config.yml | 3 +++ _includes/nav.html | 2 ++ docs/navigation-structure.md | 14 ++++++++++++++ 3 files changed, 19 insertions(+) diff --git a/_config.yml b/_config.yml index d12d439..1d5164b 100644 --- a/_config.yml +++ b/_config.yml @@ -27,6 +27,9 @@ search_enabled: true # Enable or disable heading anchors heading_anchors: true +# Restrict display of grandchildren to selected parent when true: +grandchildren_branch: false + # Aux links for the upper right navigation aux_links: "Just the Docs on GitHub": diff --git a/_includes/nav.html b/_includes/nav.html index 1c1dd2b..6ab2dbc 100644 --- a/_includes/nav.html +++ b/_includes/nav.html @@ -20,6 +20,7 @@ {%- endif -%} {{ child.title }} {%- if child.has_children -%} + {%- if page.url == child.url or page.parent == child.title or site.grandchildren_branch != true -%} {%- assign grand_children_list = site.html_pages | where: "parent", child.title | sort:"nav_order" -%} {%- endif -%} + {%- endif -%} {%- endfor -%} diff --git a/docs/navigation-structure.md b/docs/navigation-structure.md index 98107cf..cce9def 100644 --- a/docs/navigation-structure.md +++ b/docs/navigation-structure.md @@ -191,6 +191,20 @@ This would create the following navigation structure: +-- .. ``` +The current default is that when a grandparent is selected, the links to its +children *and all its grandchildren* are displayed in the navigation menu. +So in the above example, selecting `UI Components` displays the link to +`Button Child Page` as well as the link to `Buttons`. + +Setting the following global option in `_config.yml` delays the display of links +to grandchildren until their parent is selected. So selecting `UI Components` +displays only the link to `Buttons`, and the link to `Button Child Page` is +displayed when `Buttons` is selected. + +``` +grandchildren_branch: true +``` + --- ## Auxiliary Navigation From c282e4b0a7b27fc27b6cedc9bb67c992fef89dcf Mon Sep 17 00:00:00 2001 From: Peter Mosses Date: Wed, 21 Aug 2019 13:57:07 +0200 Subject: [PATCH 3/7] Update nav.html Separating new PR from #188, since indpendent. --- _includes/nav.html | 2 -- 1 file changed, 2 deletions(-) diff --git a/_includes/nav.html b/_includes/nav.html index 6ab2dbc..4305801 100644 --- a/_includes/nav.html +++ b/_includes/nav.html @@ -10,7 +10,6 @@ {%- endif -%} {{ node.title }} {%- 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" -%} {%- endif -%} - {%- endif -%} {%- endif -%} {%- endunless -%} From 5d58a663016e07e007775dbd3b1b198548f453b3 Mon Sep 17 00:00:00 2001 From: Peter Mosses Date: Thu, 22 Aug 2019 07:58:09 +0200 Subject: [PATCH 4/7] Revert "Update nav.html" This reverts commit c282e4b0a7b27fc27b6cedc9bb67c992fef89dcf. --- _includes/nav.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/_includes/nav.html b/_includes/nav.html index 4305801..6ab2dbc 100644 --- a/_includes/nav.html +++ b/_includes/nav.html @@ -10,6 +10,7 @@ {%- endif -%} {{ node.title }} {%- 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" -%} {%- endif -%} + {%- endif -%} {%- endif -%} {%- endunless -%} From 89f79138c3eecbaee272e60f416095db4944cac0 Mon Sep 17 00:00:00 2001 From: Peter Mosses Date: Thu, 22 Aug 2019 21:37:11 +0200 Subject: [PATCH 5/7] Revert "Optional delay of grandchildren link display" This reverts commit 8ac545a5eb5da8e2ebe7dda1a8bffa9d94e88cc2. --- _config.yml | 3 --- _includes/nav.html | 2 -- docs/navigation-structure.md | 14 -------------- 3 files changed, 19 deletions(-) diff --git a/_config.yml b/_config.yml index 1d5164b..d12d439 100644 --- a/_config.yml +++ b/_config.yml @@ -27,9 +27,6 @@ search_enabled: true # Enable or disable heading anchors heading_anchors: true -# Restrict display of grandchildren to selected parent when true: -grandchildren_branch: false - # Aux links for the upper right navigation aux_links: "Just the Docs on GitHub": diff --git a/_includes/nav.html b/_includes/nav.html index 6ab2dbc..1c1dd2b 100644 --- a/_includes/nav.html +++ b/_includes/nav.html @@ -20,7 +20,6 @@ {%- endif -%} {{ child.title }} {%- if child.has_children -%} - {%- if page.url == child.url or page.parent == child.title or site.grandchildren_branch != true -%} {%- assign grand_children_list = site.html_pages | where: "parent", child.title | sort:"nav_order" -%} {%- endif -%} - {%- endif -%} {%- endfor -%} diff --git a/docs/navigation-structure.md b/docs/navigation-structure.md index cce9def..98107cf 100644 --- a/docs/navigation-structure.md +++ b/docs/navigation-structure.md @@ -191,20 +191,6 @@ This would create the following navigation structure: +-- .. ``` -The current default is that when a grandparent is selected, the links to its -children *and all its grandchildren* are displayed in the navigation menu. -So in the above example, selecting `UI Components` displays the link to -`Button Child Page` as well as the link to `Buttons`. - -Setting the following global option in `_config.yml` delays the display of links -to grandchildren until their parent is selected. So selecting `UI Components` -displays only the link to `Buttons`, and the link to `Button Child Page` is -displayed when `Buttons` is selected. - -``` -grandchildren_branch: true -``` - --- ## Auxiliary Navigation From 209ac7be7db196dec85c5d0698189bf1f49a4488 Mon Sep 17 00:00:00 2001 From: Peter Mosses Date: Thu, 22 Aug 2019 21:45:09 +0200 Subject: [PATCH 6/7] Update nav.html Restrict navigation to display only direct children. --- _includes/nav.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/_includes/nav.html b/_includes/nav.html index 1c1dd2b..fdcf1e1 100644 --- a/_includes/nav.html +++ b/_includes/nav.html @@ -20,6 +20,7 @@ {%- endif -%} {{ child.title }} {%- 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" -%} {%- endif -%} + {%- endif -%} {%- endfor -%} From 13ef18501089e4c7004fadec83990787502a497d Mon Sep 17 00:00:00 2001 From: Peter Mosses Date: Thu, 29 Aug 2019 14:32:24 +0200 Subject: [PATCH 7/7] Update .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index b447a12..25e8803 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ _site Gemfile.lock node_modules +.jekyll-metadata