2019-01-06 15:49:26 -05:00
|
|
|
<nav role="navigation" aria-label="Main navigation">
|
2017-03-09 13:16:08 -05:00
|
|
|
<ul class="navigation-list">
|
2020-04-25 08:53:45 -04:00
|
|
|
{%- assign ordered_pages_list = site.html_pages | where_exp:"item", "item.nav_order != nil" -%}
|
|
|
|
{%- assign unordered_pages_list = site.html_pages | where_exp:"item", "item.nav_order == nil" -%}
|
2020-04-28 11:08:53 -04:00
|
|
|
{%- if site.nav_sort == 'case_insensitive' -%}
|
2020-04-25 08:53:45 -04:00
|
|
|
{%- assign sorted_ordered_pages_list = ordered_pages_list | sort_natural:"nav_order" -%}
|
|
|
|
{%- assign sorted_unordered_pages_list = unordered_pages_list | sort_natural:"title" -%}
|
2020-04-28 11:08:53 -04:00
|
|
|
{%- else -%}
|
|
|
|
{%- assign sorted_ordered_pages_list = ordered_pages_list | sort:"nav_order" -%}
|
|
|
|
{%- assign sorted_unordered_pages_list = unordered_pages_list | sort:"title" -%}
|
2020-04-25 08:53:45 -04:00
|
|
|
{%- endif -%}
|
|
|
|
{%- assign pages_list = sorted_ordered_pages_list | concat: sorted_unordered_pages_list -%}
|
2019-07-18 15:38:50 -04:00
|
|
|
{%- for node in pages_list -%}
|
|
|
|
{%- unless node.nav_exclude -%}
|
|
|
|
{%- if node.parent == nil -%}
|
2018-11-19 13:28:59 -05:00
|
|
|
<li class="navigation-list-item{% if page.url == node.url or page.parent == node.title or page.grand_parent == node.title %} active{% endif %}">
|
2019-07-18 15:38:50 -04:00
|
|
|
{%- if page.parent == node.title or page.grand_parent == node.title -%}
|
|
|
|
{%- assign first_level_url = node.url | absolute_url -%}
|
|
|
|
{%- endif -%}
|
2018-11-19 13:28:59 -05:00
|
|
|
<a href="{{ node.url | absolute_url }}" class="navigation-list-link{% if page.url == node.url %} active{% endif %}">{{ node.title }}</a>
|
2019-07-18 15:38:50 -04:00
|
|
|
{%- if node.has_children -%}
|
2019-10-11 16:40:34 -04:00
|
|
|
{%- assign children_list = pages_list | where: "parent", node.title -%}
|
2018-11-19 13:28:59 -05:00
|
|
|
<ul class="navigation-list-child-list ">
|
2019-07-18 15:38:50 -04:00
|
|
|
{%- for child in children_list -%}
|
2020-04-27 11:05:46 -04:00
|
|
|
{%- unless child.nav_exclude -%}
|
2019-07-18 15:38:50 -04:00
|
|
|
<li class="navigation-list-item {% if page.url == child.url or page.parent == child.title %} active{% endif %}">
|
|
|
|
{%- if page.url == child.url or page.parent == child.title -%}
|
|
|
|
{%- assign second_level_url = child.url | absolute_url -%}
|
|
|
|
{%- endif -%}
|
|
|
|
<a href="{{ child.url | absolute_url }}" class="navigation-list-link{% if page.url == child.url %} active{% endif %}">{{ child.title }}</a>
|
|
|
|
{%- if child.has_children -%}
|
2019-10-11 16:40:34 -04:00
|
|
|
{%- assign grand_children_list = pages_list | where: "parent", child.title -%}
|
2018-11-19 13:28:59 -05:00
|
|
|
<ul class="navigation-list-child-list">
|
2019-07-18 15:38:50 -04:00
|
|
|
{%- for grand_child in grand_children_list -%}
|
|
|
|
<li class="navigation-list-item {% if page.url == grand_child.url %} active{% endif %}">
|
|
|
|
<a href="{{ grand_child.url | absolute_url }}" class="navigation-list-link{% if page.url == grand_child.url %} active{% endif %}">{{ grand_child.title }}</a>
|
|
|
|
</li>
|
|
|
|
{%- endfor -%}
|
|
|
|
</ul>
|
|
|
|
{%- endif -%}
|
|
|
|
</li>
|
2020-04-27 11:05:46 -04:00
|
|
|
{%- endunless -%}
|
2019-07-18 15:38:50 -04:00
|
|
|
{%- endfor -%}
|
2018-11-19 13:28:59 -05:00
|
|
|
</ul>
|
2019-07-18 15:38:50 -04:00
|
|
|
{%- endif -%}
|
2018-11-19 13:28:59 -05:00
|
|
|
</li>
|
2019-07-18 15:38:50 -04:00
|
|
|
{%- endif -%}
|
|
|
|
{%- endunless -%}
|
|
|
|
{%- endfor -%}
|
2017-03-09 13:16:08 -05:00
|
|
|
</ul>
|
|
|
|
</nav>
|