1
0
mirror of https://github.com/thangisme/notes.git synced 2024-12-23 03:06:23 -05:00
notes/_includes/nav.html

45 lines
2.5 KiB
HTML
Raw Normal View History

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">
2018-11-19 13:28:59 -05:00
{% assign pages_list = site.html_pages | sort:"nav_order" %}
2018-11-16 13:57:32 -05:00
{% for node in pages_list %}
2018-11-19 13:28:59 -05:00
{% unless node.nav_exclude %}
{% if node.parent == nil %}
<li class="navigation-list-item{% if page.url == node.url or page.parent == node.title or page.grand_parent == node.title %} active{% endif %}">
{% if page.parent == node.title or page.grand_parent == node.title %}
{% assign first_level_url = node.url | absolute_url %}
{% endif %}
<a href="{{ node.url | absolute_url }}" class="navigation-list-link{% if page.url == node.url %} active{% endif %}">{{ node.title }}</a>
{% if node.has_children %}
{% assign children_list = site.html_pages | sort:"nav_order" %}
<ul class="navigation-list-child-list ">
{% for child in children_list %}
{% if child.parent == node.title %}
<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 %}
{% assign grand_children_list = site.html_pages | sort:"nav_order" %}
<ul class="navigation-list-child-list">
{% for grand_child in grand_children_list %}
{% if grand_child.parent == child.title %}
<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>
{% endif %}
{% endfor %}
</ul>
{% endif %}
</li>
{% endif %}
{% endfor %}
</ul>
{% endif %}
</li>
2017-03-09 13:16:08 -05:00
{% endif %}
2018-11-19 13:28:59 -05:00
{% endunless %}
2018-11-16 13:57:32 -05:00
{% endfor %}
2017-03-09 13:16:08 -05:00
</ul>
</nav>