mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2025-09-07 14:58:56 +00:00
30 lines
939 B
Plaintext
30 lines
939 B
Plaintext
{% macro renderNav(items, pageUrl) %}
|
|
<ul>
|
|
{% for item in items %}
|
|
<li>
|
|
{% if item.children and item.children.length %}
|
|
{% set sectionPath = item.path | replace('index.html', '') %}
|
|
<details class="nav-section" {% if pageUrl.startsWith(sectionPath) %}open{% endif %}>
|
|
<summary>
|
|
<a href="{{ item.path }}" class="nav-link{% if item.path === pageUrl %} active{% endif %}">
|
|
{{ item.displayName or item.page.title }}
|
|
</a>
|
|
</summary>
|
|
{{ renderNav(item.children, pageUrl) }}
|
|
</details>
|
|
{% else %}
|
|
<a href="{{ item.path }}" class="nav-link{% if item.path === pageUrl %} active{% endif %}">
|
|
{{ item.displayName or item.page.title }}
|
|
</a>
|
|
{% endif %}
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% endmacro %}
|
|
|
|
<aside class="sidebar" id="sidebar">
|
|
<nav>
|
|
{{ renderNav(navigation, page.url) }}
|
|
</nav>
|
|
</aside>
|