opensearch-docs-cn/_includes/nav.html

163 lines
7.6 KiB
HTML
Raw Permalink Normal View History

Toc keyboard navigation (#4497) * Adds keyboard navigation to table of content links Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds table of contents scroll and item focus management to the current page or the first toc item Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Add space key capture to the toc expand/collapse arrows Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds escape key support for expand/collapse of toc categories on the category label Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds missing aria-role and aria-current attributes to toc affordances Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Changes the function of the space bar to navigate to a toc parent category item instead of only expand its children Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds arrow up/down key support to toc navigation Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds missing accessibility attribute handling to the toc Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects arrow key handling of keyboard navigation of the toc Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds padding to allow for the keyboard focus rectangle Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes explicit tabindex values for the toc navigation Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes auto focus of toc navigation items on page load; refactors navigation panel scroll into view logic to account for the sticky version selector Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes keyboard focus trap on search field for the tab key Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Unifies navigation item focus state for top level items and sub navigation items Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes the expand/collapse navigation buttons from being tab focusable Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects navigation item spacing to permit visible focus rectangles Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Implements full arrow navigation for the toc items according to the w3c tree view navigation pattern Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds reference link to the w3c documentation about the tree view navigation to the arrow key toc navigation javascript Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Account for the difference between the navigation panel height, and the viewport height when auto scrolling the toc item of the current page Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects keyboard navigation focus rectangles from being slightly obscured on the bottom Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects aria and role attributes according to the navigation tree pattern as opposed to the disclosure pattern Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects Jekyll include parameter assignment syntax error Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes aria-expanded setting from the templates since it is unrealiable to determine without iterating through the entire tree to determine if one of its children of children is the current page Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Moves setting of aria-expanded attributes to a runtime behavior, and corrects arrow left/right behavior on navigation tree items Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Ensures unique navigation menu element ids; conditionally sets aira-owns and aria-current attributes Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes JavaScript that is unused following refactoring tree view navigation; adds comments explaining choices Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> --------- Signed-off-by: Aaron Stephanus <taoist.futility@pm.me>
2023-07-17 13:11:42 -04:00
<ul
role="tree"
aria-expanded="{{ include.expanded | default: 'false' }}"
class="nav-list"
{%- if include.owned_tree_id -%}id="{{ include.owned_tree_id }}"{%- endif -%}
>
2021-05-05 13:09:47 -04:00
{%- assign titled_pages = include.pages
| where_exp:"item", "item.title != nil" -%}
{%- comment -%}
The values of `title` and `nav_order` can be numbers or strings.
Jekyll gives build failures when sorting on mixtures of different types,
so numbers and strings need to be sorted separately.
Here, numbers are sorted by their values, and come before all strings.
An omitted `nav_order` value is equivalent to the page's `title` value
(except that a numerical `title` value is treated as a string).
The case-sensitivity of string sorting is determined by `site.nav_sort`.
{%- endcomment -%}
{%- assign string_ordered_pages = titled_pages
| where_exp:"item", "item.nav_order == nil" -%}
{%- assign nav_ordered_pages = titled_pages
| where_exp:"item", "item.nav_order != nil" -%}
{%- comment -%}
The nav_ordered_pages have to be added to number_ordered_pages and
string_ordered_pages, depending on the nav_order value.
The first character of the jsonify result is `"` only for strings.
{%- endcomment -%}
{%- assign nav_ordered_groups = nav_ordered_pages
| group_by_exp:"item", "item.nav_order | jsonify | slice: 0" -%}
{%- assign number_ordered_pages = "" | split:"X" -%}
{%- for group in nav_ordered_groups -%}
{%- if group.name == '"' -%}
{%- assign string_ordered_pages = string_ordered_pages | concat: group.items -%}
{%- else -%}
{%- assign number_ordered_pages = number_ordered_pages | concat: group.items -%}
{%- endif -%}
{%- endfor -%}
{%- assign sorted_number_ordered_pages = number_ordered_pages | sort:"nav_order" -%}
{%- comment -%}
The string_ordered_pages have to be sorted by nav_order, and otherwise title
(where appending the empty string to a numeric title converts it to a string).
After grouping them by those values, the groups are sorted, then the items
of each group are concatenated.
{%- endcomment -%}
{%- assign string_ordered_groups = string_ordered_pages
| group_by_exp:"item", "item.nav_order | default: item.title | append:''" -%}
{%- if site.nav_sort == 'case_insensitive' -%}
{%- assign sorted_string_ordered_groups = string_ordered_groups | sort_natural:"name" -%}
{%- else -%}
{%- assign sorted_string_ordered_groups = string_ordered_groups | sort:"name" -%}
{%- endif -%}
{%- assign sorted_string_ordered_pages = "" | split:"X" -%}
{%- for group in sorted_string_ordered_groups -%}
{%- assign sorted_string_ordered_pages = sorted_string_ordered_pages | concat: group.items -%}
{%- endfor -%}
{%- assign pages_list = sorted_number_ordered_pages | concat: sorted_string_ordered_pages -%}
Toc keyboard navigation (#4497) * Adds keyboard navigation to table of content links Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds table of contents scroll and item focus management to the current page or the first toc item Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Add space key capture to the toc expand/collapse arrows Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds escape key support for expand/collapse of toc categories on the category label Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds missing aria-role and aria-current attributes to toc affordances Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Changes the function of the space bar to navigate to a toc parent category item instead of only expand its children Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds arrow up/down key support to toc navigation Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds missing accessibility attribute handling to the toc Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects arrow key handling of keyboard navigation of the toc Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds padding to allow for the keyboard focus rectangle Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes explicit tabindex values for the toc navigation Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes auto focus of toc navigation items on page load; refactors navigation panel scroll into view logic to account for the sticky version selector Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes keyboard focus trap on search field for the tab key Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Unifies navigation item focus state for top level items and sub navigation items Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes the expand/collapse navigation buttons from being tab focusable Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects navigation item spacing to permit visible focus rectangles Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Implements full arrow navigation for the toc items according to the w3c tree view navigation pattern Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds reference link to the w3c documentation about the tree view navigation to the arrow key toc navigation javascript Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Account for the difference between the navigation panel height, and the viewport height when auto scrolling the toc item of the current page Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects keyboard navigation focus rectangles from being slightly obscured on the bottom Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects aria and role attributes according to the navigation tree pattern as opposed to the disclosure pattern Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects Jekyll include parameter assignment syntax error Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes aria-expanded setting from the templates since it is unrealiable to determine without iterating through the entire tree to determine if one of its children of children is the current page Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Moves setting of aria-expanded attributes to a runtime behavior, and corrects arrow left/right behavior on navigation tree items Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Ensures unique navigation menu element ids; conditionally sets aira-owns and aria-current attributes Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes JavaScript that is unused following refactoring tree view navigation; adds comments explaining choices Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> --------- Signed-off-by: Aaron Stephanus <taoist.futility@pm.me>
2023-07-17 13:11:42 -04:00
2021-05-05 13:09:47 -04:00
{%- for node in pages_list -%}
{%- if node.parent == nil -%}
{%- unless node.nav_exclude -%}
Toc keyboard navigation (#4497) * Adds keyboard navigation to table of content links Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds table of contents scroll and item focus management to the current page or the first toc item Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Add space key capture to the toc expand/collapse arrows Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds escape key support for expand/collapse of toc categories on the category label Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds missing aria-role and aria-current attributes to toc affordances Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Changes the function of the space bar to navigate to a toc parent category item instead of only expand its children Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds arrow up/down key support to toc navigation Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds missing accessibility attribute handling to the toc Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects arrow key handling of keyboard navigation of the toc Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds padding to allow for the keyboard focus rectangle Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes explicit tabindex values for the toc navigation Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes auto focus of toc navigation items on page load; refactors navigation panel scroll into view logic to account for the sticky version selector Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes keyboard focus trap on search field for the tab key Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Unifies navigation item focus state for top level items and sub navigation items Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes the expand/collapse navigation buttons from being tab focusable Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects navigation item spacing to permit visible focus rectangles Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Implements full arrow navigation for the toc items according to the w3c tree view navigation pattern Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds reference link to the w3c documentation about the tree view navigation to the arrow key toc navigation javascript Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Account for the difference between the navigation panel height, and the viewport height when auto scrolling the toc item of the current page Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects keyboard navigation focus rectangles from being slightly obscured on the bottom Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects aria and role attributes according to the navigation tree pattern as opposed to the disclosure pattern Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects Jekyll include parameter assignment syntax error Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes aria-expanded setting from the templates since it is unrealiable to determine without iterating through the entire tree to determine if one of its children of children is the current page Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Moves setting of aria-expanded attributes to a runtime behavior, and corrects arrow left/right behavior on navigation tree items Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Ensures unique navigation menu element ids; conditionally sets aira-owns and aria-current attributes Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes JavaScript that is unused following refactoring tree view navigation; adds comments explaining choices Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> --------- Signed-off-by: Aaron Stephanus <taoist.futility@pm.me>
2023-07-17 13:11:42 -04:00
{% assign nested_owned_tree_id = include.owned_tree_id | append: "_" | append: forloop.index | append: "_" | append: node.title | append: "_navitems" | replace: " ", "_" %}
<li role="none" class="nav-list-item{% if page.collection == include.key and page.url == node.url or page.parent == node.title or page.grand_parent == node.title %} active{% endif %}">
2021-05-05 13:09:47 -04:00
{%- if node.has_children -%}
Toc keyboard navigation (#4497) * Adds keyboard navigation to table of content links Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds table of contents scroll and item focus management to the current page or the first toc item Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Add space key capture to the toc expand/collapse arrows Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds escape key support for expand/collapse of toc categories on the category label Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds missing aria-role and aria-current attributes to toc affordances Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Changes the function of the space bar to navigate to a toc parent category item instead of only expand its children Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds arrow up/down key support to toc navigation Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds missing accessibility attribute handling to the toc Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects arrow key handling of keyboard navigation of the toc Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds padding to allow for the keyboard focus rectangle Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes explicit tabindex values for the toc navigation Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes auto focus of toc navigation items on page load; refactors navigation panel scroll into view logic to account for the sticky version selector Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes keyboard focus trap on search field for the tab key Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Unifies navigation item focus state for top level items and sub navigation items Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes the expand/collapse navigation buttons from being tab focusable Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects navigation item spacing to permit visible focus rectangles Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Implements full arrow navigation for the toc items according to the w3c tree view navigation pattern Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds reference link to the w3c documentation about the tree view navigation to the arrow key toc navigation javascript Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Account for the difference between the navigation panel height, and the viewport height when auto scrolling the toc item of the current page Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects keyboard navigation focus rectangles from being slightly obscured on the bottom Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects aria and role attributes according to the navigation tree pattern as opposed to the disclosure pattern Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects Jekyll include parameter assignment syntax error Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes aria-expanded setting from the templates since it is unrealiable to determine without iterating through the entire tree to determine if one of its children of children is the current page Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Moves setting of aria-expanded attributes to a runtime behavior, and corrects arrow left/right behavior on navigation tree items Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Ensures unique navigation menu element ids; conditionally sets aira-owns and aria-current attributes Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes JavaScript that is unused following refactoring tree view navigation; adds comments explaining choices Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> --------- Signed-off-by: Aaron Stephanus <taoist.futility@pm.me>
2023-07-17 13:11:42 -04:00
<a
role="treeitem"
aria-owns="{{ nested_owned_tree_id }}"
{%- if page.url == node.url -%}aria-current="page"{%- endif -%}
href="#"
class="nav-list-expander"
><svg viewBox="0 0 24 24"><use xlink:href="#svg-arrow-right"></use></svg></a>
2021-05-05 13:09:47 -04:00
{%- endif -%}
Toc keyboard navigation (#4497) * Adds keyboard navigation to table of content links Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds table of contents scroll and item focus management to the current page or the first toc item Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Add space key capture to the toc expand/collapse arrows Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds escape key support for expand/collapse of toc categories on the category label Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds missing aria-role and aria-current attributes to toc affordances Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Changes the function of the space bar to navigate to a toc parent category item instead of only expand its children Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds arrow up/down key support to toc navigation Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds missing accessibility attribute handling to the toc Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects arrow key handling of keyboard navigation of the toc Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds padding to allow for the keyboard focus rectangle Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes explicit tabindex values for the toc navigation Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes auto focus of toc navigation items on page load; refactors navigation panel scroll into view logic to account for the sticky version selector Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes keyboard focus trap on search field for the tab key Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Unifies navigation item focus state for top level items and sub navigation items Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes the expand/collapse navigation buttons from being tab focusable Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects navigation item spacing to permit visible focus rectangles Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Implements full arrow navigation for the toc items according to the w3c tree view navigation pattern Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds reference link to the w3c documentation about the tree view navigation to the arrow key toc navigation javascript Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Account for the difference between the navigation panel height, and the viewport height when auto scrolling the toc item of the current page Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects keyboard navigation focus rectangles from being slightly obscured on the bottom Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects aria and role attributes according to the navigation tree pattern as opposed to the disclosure pattern Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects Jekyll include parameter assignment syntax error Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes aria-expanded setting from the templates since it is unrealiable to determine without iterating through the entire tree to determine if one of its children of children is the current page Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Moves setting of aria-expanded attributes to a runtime behavior, and corrects arrow left/right behavior on navigation tree items Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Ensures unique navigation menu element ids; conditionally sets aira-owns and aria-current attributes Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes JavaScript that is unused following refactoring tree view navigation; adds comments explaining choices Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> --------- Signed-off-by: Aaron Stephanus <taoist.futility@pm.me>
2023-07-17 13:11:42 -04:00
<a
role="treeitem"
{%- if node.has_children -%}aria-owns="{{ nested_owned_tree_id }}"{%- endif -%}
{%- if page.url == node.url -%}aria-current="page"{%- endif -%}
href="{{ node.url | absolute_url }}"
class="nav-list-link{% if page.url == node.url %} active{% endif %}"
>{{ node.title }}</a>
2021-05-05 13:09:47 -04:00
{%- if node.has_children -%}
{%- assign children_list = pages_list | where: "parent", node.title -%}
Toc keyboard navigation (#4497) * Adds keyboard navigation to table of content links Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds table of contents scroll and item focus management to the current page or the first toc item Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Add space key capture to the toc expand/collapse arrows Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds escape key support for expand/collapse of toc categories on the category label Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds missing aria-role and aria-current attributes to toc affordances Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Changes the function of the space bar to navigate to a toc parent category item instead of only expand its children Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds arrow up/down key support to toc navigation Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds missing accessibility attribute handling to the toc Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects arrow key handling of keyboard navigation of the toc Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds padding to allow for the keyboard focus rectangle Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes explicit tabindex values for the toc navigation Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes auto focus of toc navigation items on page load; refactors navigation panel scroll into view logic to account for the sticky version selector Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes keyboard focus trap on search field for the tab key Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Unifies navigation item focus state for top level items and sub navigation items Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes the expand/collapse navigation buttons from being tab focusable Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects navigation item spacing to permit visible focus rectangles Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Implements full arrow navigation for the toc items according to the w3c tree view navigation pattern Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds reference link to the w3c documentation about the tree view navigation to the arrow key toc navigation javascript Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Account for the difference between the navigation panel height, and the viewport height when auto scrolling the toc item of the current page Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects keyboard navigation focus rectangles from being slightly obscured on the bottom Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects aria and role attributes according to the navigation tree pattern as opposed to the disclosure pattern Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects Jekyll include parameter assignment syntax error Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes aria-expanded setting from the templates since it is unrealiable to determine without iterating through the entire tree to determine if one of its children of children is the current page Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Moves setting of aria-expanded attributes to a runtime behavior, and corrects arrow left/right behavior on navigation tree items Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Ensures unique navigation menu element ids; conditionally sets aira-owns and aria-current attributes Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes JavaScript that is unused following refactoring tree view navigation; adds comments explaining choices Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> --------- Signed-off-by: Aaron Stephanus <taoist.futility@pm.me>
2023-07-17 13:11:42 -04:00
<ul role="tree" class="nav-list" id="{{ nested_owned_tree_id }}">
2021-05-05 13:09:47 -04:00
{%- for child in children_list -%}
{%- unless child.nav_exclude -%}
Toc keyboard navigation (#4497) * Adds keyboard navigation to table of content links Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds table of contents scroll and item focus management to the current page or the first toc item Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Add space key capture to the toc expand/collapse arrows Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds escape key support for expand/collapse of toc categories on the category label Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds missing aria-role and aria-current attributes to toc affordances Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Changes the function of the space bar to navigate to a toc parent category item instead of only expand its children Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds arrow up/down key support to toc navigation Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds missing accessibility attribute handling to the toc Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects arrow key handling of keyboard navigation of the toc Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds padding to allow for the keyboard focus rectangle Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes explicit tabindex values for the toc navigation Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes auto focus of toc navigation items on page load; refactors navigation panel scroll into view logic to account for the sticky version selector Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes keyboard focus trap on search field for the tab key Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Unifies navigation item focus state for top level items and sub navigation items Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes the expand/collapse navigation buttons from being tab focusable Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects navigation item spacing to permit visible focus rectangles Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Implements full arrow navigation for the toc items according to the w3c tree view navigation pattern Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds reference link to the w3c documentation about the tree view navigation to the arrow key toc navigation javascript Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Account for the difference between the navigation panel height, and the viewport height when auto scrolling the toc item of the current page Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects keyboard navigation focus rectangles from being slightly obscured on the bottom Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects aria and role attributes according to the navigation tree pattern as opposed to the disclosure pattern Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects Jekyll include parameter assignment syntax error Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes aria-expanded setting from the templates since it is unrealiable to determine without iterating through the entire tree to determine if one of its children of children is the current page Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Moves setting of aria-expanded attributes to a runtime behavior, and corrects arrow left/right behavior on navigation tree items Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Ensures unique navigation menu element ids; conditionally sets aira-owns and aria-current attributes Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes JavaScript that is unused following refactoring tree view navigation; adds comments explaining choices Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> --------- Signed-off-by: Aaron Stephanus <taoist.futility@pm.me>
2023-07-17 13:11:42 -04:00
<li role="none" class="nav-list-item {% if page.url == child.url or page.parent == child.title %} active{% endif %}">
2021-05-05 13:09:47 -04:00
{%- if child.has_children -%}
Toc keyboard navigation (#4497) * Adds keyboard navigation to table of content links Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds table of contents scroll and item focus management to the current page or the first toc item Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Add space key capture to the toc expand/collapse arrows Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds escape key support for expand/collapse of toc categories on the category label Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds missing aria-role and aria-current attributes to toc affordances Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Changes the function of the space bar to navigate to a toc parent category item instead of only expand its children Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds arrow up/down key support to toc navigation Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds missing accessibility attribute handling to the toc Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects arrow key handling of keyboard navigation of the toc Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds padding to allow for the keyboard focus rectangle Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes explicit tabindex values for the toc navigation Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes auto focus of toc navigation items on page load; refactors navigation panel scroll into view logic to account for the sticky version selector Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes keyboard focus trap on search field for the tab key Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Unifies navigation item focus state for top level items and sub navigation items Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes the expand/collapse navigation buttons from being tab focusable Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects navigation item spacing to permit visible focus rectangles Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Implements full arrow navigation for the toc items according to the w3c tree view navigation pattern Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds reference link to the w3c documentation about the tree view navigation to the arrow key toc navigation javascript Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Account for the difference between the navigation panel height, and the viewport height when auto scrolling the toc item of the current page Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects keyboard navigation focus rectangles from being slightly obscured on the bottom Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects aria and role attributes according to the navigation tree pattern as opposed to the disclosure pattern Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects Jekyll include parameter assignment syntax error Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes aria-expanded setting from the templates since it is unrealiable to determine without iterating through the entire tree to determine if one of its children of children is the current page Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Moves setting of aria-expanded attributes to a runtime behavior, and corrects arrow left/right behavior on navigation tree items Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Ensures unique navigation menu element ids; conditionally sets aira-owns and aria-current attributes Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes JavaScript that is unused following refactoring tree view navigation; adds comments explaining choices Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> --------- Signed-off-by: Aaron Stephanus <taoist.futility@pm.me>
2023-07-17 13:11:42 -04:00
{% assign nested_nested_owned_tree_id = nested_owned_tree_id | append: "_" | append: forloop.index | append: "_" | append: child.title | append: "_navitems" | replace: " ", "_" %}
<a
role="treeitem"
aria-owns="{{ nested_nested_owned_tree_id }}"
{%- if page.url == node.url -%}aria-current="page"{%- endif -%}
href="#"
class="nav-list-expander"
><svg viewBox="0 0 24 24"><use xlink:href="#svg-arrow-right"></use></svg></a>
2021-05-05 13:09:47 -04:00
{%- endif -%}
Toc keyboard navigation (#4497) * Adds keyboard navigation to table of content links Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds table of contents scroll and item focus management to the current page or the first toc item Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Add space key capture to the toc expand/collapse arrows Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds escape key support for expand/collapse of toc categories on the category label Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds missing aria-role and aria-current attributes to toc affordances Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Changes the function of the space bar to navigate to a toc parent category item instead of only expand its children Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds arrow up/down key support to toc navigation Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds missing accessibility attribute handling to the toc Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects arrow key handling of keyboard navigation of the toc Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds padding to allow for the keyboard focus rectangle Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes explicit tabindex values for the toc navigation Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes auto focus of toc navigation items on page load; refactors navigation panel scroll into view logic to account for the sticky version selector Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes keyboard focus trap on search field for the tab key Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Unifies navigation item focus state for top level items and sub navigation items Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes the expand/collapse navigation buttons from being tab focusable Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects navigation item spacing to permit visible focus rectangles Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Implements full arrow navigation for the toc items according to the w3c tree view navigation pattern Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds reference link to the w3c documentation about the tree view navigation to the arrow key toc navigation javascript Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Account for the difference between the navigation panel height, and the viewport height when auto scrolling the toc item of the current page Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects keyboard navigation focus rectangles from being slightly obscured on the bottom Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects aria and role attributes according to the navigation tree pattern as opposed to the disclosure pattern Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects Jekyll include parameter assignment syntax error Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes aria-expanded setting from the templates since it is unrealiable to determine without iterating through the entire tree to determine if one of its children of children is the current page Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Moves setting of aria-expanded attributes to a runtime behavior, and corrects arrow left/right behavior on navigation tree items Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Ensures unique navigation menu element ids; conditionally sets aira-owns and aria-current attributes Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes JavaScript that is unused following refactoring tree view navigation; adds comments explaining choices Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> --------- Signed-off-by: Aaron Stephanus <taoist.futility@pm.me>
2023-07-17 13:11:42 -04:00
<a
role="treeitem"
{%- if child.has_children -%}aria-owns="{{ nested_nested_owned_tree_id }}"{%- endif -%}
{%- if page.url == node.url -%}aria-current="page"{%- endif -%}
href="{{ child.url | absolute_url }}"
class="nav-list-link{% if page.url == child.url %} active{% endif %}"
>{{ child.title }}</a>
2021-05-05 13:09:47 -04:00
{%- if child.has_children -%}
{%- assign grand_children_list = pages_list | where: "parent", child.title | where: "grand_parent", node.title -%}
Toc keyboard navigation (#4497) * Adds keyboard navigation to table of content links Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds table of contents scroll and item focus management to the current page or the first toc item Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Add space key capture to the toc expand/collapse arrows Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds escape key support for expand/collapse of toc categories on the category label Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds missing aria-role and aria-current attributes to toc affordances Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Changes the function of the space bar to navigate to a toc parent category item instead of only expand its children Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds arrow up/down key support to toc navigation Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds missing accessibility attribute handling to the toc Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects arrow key handling of keyboard navigation of the toc Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds padding to allow for the keyboard focus rectangle Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes explicit tabindex values for the toc navigation Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes auto focus of toc navigation items on page load; refactors navigation panel scroll into view logic to account for the sticky version selector Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes keyboard focus trap on search field for the tab key Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Unifies navigation item focus state for top level items and sub navigation items Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes the expand/collapse navigation buttons from being tab focusable Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects navigation item spacing to permit visible focus rectangles Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Implements full arrow navigation for the toc items according to the w3c tree view navigation pattern Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds reference link to the w3c documentation about the tree view navigation to the arrow key toc navigation javascript Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Account for the difference between the navigation panel height, and the viewport height when auto scrolling the toc item of the current page Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects keyboard navigation focus rectangles from being slightly obscured on the bottom Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects aria and role attributes according to the navigation tree pattern as opposed to the disclosure pattern Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects Jekyll include parameter assignment syntax error Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes aria-expanded setting from the templates since it is unrealiable to determine without iterating through the entire tree to determine if one of its children of children is the current page Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Moves setting of aria-expanded attributes to a runtime behavior, and corrects arrow left/right behavior on navigation tree items Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Ensures unique navigation menu element ids; conditionally sets aira-owns and aria-current attributes Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes JavaScript that is unused following refactoring tree view navigation; adds comments explaining choices Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> --------- Signed-off-by: Aaron Stephanus <taoist.futility@pm.me>
2023-07-17 13:11:42 -04:00
<ul role="tree" class="nav-list" id="{{ nested_nested_owned_tree_id }}">
2021-05-05 13:09:47 -04:00
{%- for grand_child in grand_children_list -%}
{%- unless grand_child.nav_exclude -%}
Toc keyboard navigation (#4497) * Adds keyboard navigation to table of content links Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds table of contents scroll and item focus management to the current page or the first toc item Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Add space key capture to the toc expand/collapse arrows Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds escape key support for expand/collapse of toc categories on the category label Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds missing aria-role and aria-current attributes to toc affordances Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Changes the function of the space bar to navigate to a toc parent category item instead of only expand its children Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds arrow up/down key support to toc navigation Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds missing accessibility attribute handling to the toc Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects arrow key handling of keyboard navigation of the toc Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds padding to allow for the keyboard focus rectangle Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes explicit tabindex values for the toc navigation Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes auto focus of toc navigation items on page load; refactors navigation panel scroll into view logic to account for the sticky version selector Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes keyboard focus trap on search field for the tab key Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Unifies navigation item focus state for top level items and sub navigation items Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes the expand/collapse navigation buttons from being tab focusable Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects navigation item spacing to permit visible focus rectangles Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Implements full arrow navigation for the toc items according to the w3c tree view navigation pattern Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Adds reference link to the w3c documentation about the tree view navigation to the arrow key toc navigation javascript Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Account for the difference between the navigation panel height, and the viewport height when auto scrolling the toc item of the current page Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects keyboard navigation focus rectangles from being slightly obscured on the bottom Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects aria and role attributes according to the navigation tree pattern as opposed to the disclosure pattern Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Corrects Jekyll include parameter assignment syntax error Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes aria-expanded setting from the templates since it is unrealiable to determine without iterating through the entire tree to determine if one of its children of children is the current page Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Moves setting of aria-expanded attributes to a runtime behavior, and corrects arrow left/right behavior on navigation tree items Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Ensures unique navigation menu element ids; conditionally sets aira-owns and aria-current attributes Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> * Removes JavaScript that is unused following refactoring tree view navigation; adds comments explaining choices Signed-off-by: Aaron Stephanus <taoist.futility@pm.me> --------- Signed-off-by: Aaron Stephanus <taoist.futility@pm.me>
2023-07-17 13:11:42 -04:00
<li role="none" class="nav-list-item {% if page.url == grand_child.url %} active{% endif %}">
<a
role="treeitem"
{%- if page.url == grand_child.url -%}aria-current="page"{%- endif -%}
href="{{ grand_child.url | absolute_url }}"
class="nav-list-link{% if page.url == grand_child.url %} active{% endif %}"
>{{ grand_child.title }}</a>
2021-05-05 13:09:47 -04:00
</li>
{%- endunless -%}
{%- endfor -%}
</ul>
{%- endif -%}
</li>
{%- endunless -%}
{%- endfor -%}
</ul>
{%- endif -%}
</li>
{%- endunless -%}
{%- endif -%}
{%- endfor -%}
</ul>
2021-05-28 13:48:19 -04:00
{%- if page.collection == include.key -%}
{%- for node in pages_list -%}
{%- if node.parent == nil -%}
{%- if page.parent == node.title or page.grand_parent == node.title -%}
{%- assign first_level_url = node.url | absolute_url -%}
{%- endif -%}
{%- if node.has_children -%}
{%- assign children_list = pages_list | where: "parent", node.title -%}
{%- for child in children_list -%}
{%- if child.has_children -%}
{%- if page.url == child.url or page.parent == child.title and page.grand_parent == child.parent -%}
{%- assign second_level_url = child.url | absolute_url -%}
{%- endif -%}
{%- endif -%}
{%- endfor -%}
{%- endif -%}
{%- endif -%}
{%- endfor -%}
{% if page.has_children == true and page.has_toc != false %}
{%- assign toc_list = pages_list | where: "parent", page.title | where: "grand_parent", page.parent -%}
{%- endif -%}
{%- endif -%}