mirror of
https://github.com/Theodor-Springmann-Stiftung/jacoblenz.git
synced 2025-10-30 09:45:33 +00:00
36 lines
1.1 KiB
Plaintext
36 lines
1.1 KiB
Plaintext
{# From https://www.11ty.dev/docs/plugins/navigation/ #}
|
|
{% set navPages = collections.all | eleventyNavigation %}
|
|
|
|
{% macro renderNavListItem(entry) -%}
|
|
<li>
|
|
{% if not entry.children.length %}
|
|
<a {% if entry.url == page.url %} class="active"{% endif %} href="{{ entry.url }}">{{ entry.title }}</a>
|
|
{% if entry.status == "Abgeschlossen" %}
|
|
<span class="inline-block bg-slate-200 ml-1 px-1.5 rounded relative bottom-0.5 text-xs shadow-sm
|
|
align-bottom">Abgeschlossen</span>
|
|
{% elseif entry.status == "Laufend" %}
|
|
<span class="inline-block bg-slate-200 ml-1 px-1.5 rounded relative bottom-0.5 text-xs shadow-sm
|
|
align-bottom">in
|
|
Vorbereitung</span>
|
|
{% endif %}
|
|
|
|
{% else %}
|
|
<div>{{ entry.title }}</div>
|
|
{% endif %}
|
|
|
|
{%- if entry.children.length -%}
|
|
<ul>
|
|
{%- for child in entry.children %}
|
|
{{ renderNavListItem(child) }}
|
|
{% endfor -%}
|
|
</ul>
|
|
{%- endif -%}
|
|
</li>
|
|
{%- endmacro %}
|
|
|
|
<nav class="hidden-important desktop:!block py-4 sidebar-nav px-4" id="navigation">
|
|
<ul>
|
|
{%- for entry in navPages %}{{ renderNavListItem(entry) }}{%- endfor -%}
|
|
</ul>
|
|
</nav>
|