Fix sidebar navigation rendering

This commit is contained in:
thePR0M3TH3AN
2025-07-10 13:04:41 -04:00
parent 18e2f45f6a
commit d7c38a9326
2 changed files with 15 additions and 5 deletions

View File

@@ -60,6 +60,7 @@ body {
padding: 1rem; padding: 1rem;
} }
.sidebar ul { list-style: none; padding: 0; } .sidebar ul { list-style: none; padding: 0; }
.sidebar ul ul { padding-left: 1rem; }
.sidebar a { text-decoration: none; color: var(--text-color); } .sidebar a { text-decoration: none; color: var(--text-color); }
main { main {
flex: 1; flex: 1;

View File

@@ -1,9 +1,18 @@
<aside class="sidebar" id="sidebar"> {% macro renderNav(items) %}
<nav>
<ul> <ul>
{% for item in navigation %} {% for item in items %}
<li><a href="{{ item.path }}">{{ item.page.title }}</a></li> <li>
<a href="{{ item.path }}">{{ item.page.title }}</a>
{% if item.children and item.children.length %}
{{ renderNav(item.children) }}
{% endif %}
</li>
{% endfor %} {% endfor %}
</ul> </ul>
{% endmacro %}
<aside class="sidebar" id="sidebar">
<nav>
{{ renderNav(navigation) }}
</nav> </nav>
</aside> </aside>