1
0
mirror of https://github.com/thangisme/notes.git synced 2024-12-22 09:36:41 -05:00
notes/_includes/nav.html
2018-11-16 13:57:32 -05:00

27 lines
1.3 KiB
HTML

<nav>
<ul class="navigation-list">
{% assign pages_list = site.html_pages | sort:"nav_order" %}
{% for node in pages_list %}
{% unless node.nav_exclude %}
<li class="navigation-list-item{% if page.url == node.url %} active{% endif %} js-side-nav-item">
{% if node.parent == nil or node.has_children == true %}
<a href="{{ node.url | absolute_url }}" class="navigation-list-link{% if page.url == node.url or (page.parent != nil and page.parent == node.parent) %} active{% endif %}">{{ node.title }}</a>
{% if (node.has_children == true and node.parent == page.parent) %}
{% assign children_list = site.html_pages | sort:"nav_order" %}
<ul class="navigation-list-child-list">
{% for child in children_list %}
{% if child.parent == node.parent and child.title != node.title %}
<li class="navigation-list-item {% if page.url == child.url %} active{% endif %}">
<a href="{{ child.url | absolute_url }}" class="navigation-list-link{% if page.url == child.url %} active{% endif %}">{{ child.title }}</a>
</li>
{% endif %}
{% endfor %}
</ul>
{% endif %}
{% endif %}
</li>
{% endunless %}
{% endfor %}
</ul>
</nav>