You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.6 KiB
HTML
40 lines
1.6 KiB
HTML
<nav class="">
|
|
{# --- home button --- -#}
|
|
<a href="{{get_url(path="/")}}" class="item {% if current_path %}{% if current_path == "/" %} active{% endif %}{% endif %}"><div>{{config.extra.name}}</div></a>
|
|
|
|
{# --- menu links --- -#}
|
|
<span>
|
|
{%- for link in config.extra.nav.links %}
|
|
{#- hack to get page or section #}
|
|
{%- if link is ending_with("_index.md") -%}
|
|
{%- set s = get_section(path=link) -%}
|
|
{%- if not s.extra.hide -%}
|
|
<div class="dropdown">
|
|
<a href="{{s.permalink}}" class="dropper
|
|
{%- if current_path %}{% if current_path is starting_with(s.path) %} active{% endif %}{% endif -%}">{{s.title}}
|
|
{%- if s.extra.no_dropdown %}{# nothing #}{% else %}{{i::caret_down(color="white")}}{% endif %}</a>
|
|
<div class="dropdown-content">
|
|
{%- for sec in s.subsections -%}
|
|
{%- set sec = get_section(path=sec) -%}
|
|
<a href="{{sec.permalink}}"><span>{{sec.title}}</span></a>
|
|
{% endfor -%}
|
|
{% if s.extra.list_pages %}
|
|
{%- for page in s.pages -%}
|
|
<a href="{{page.permalink}}"><span>{{page.title}}</span></a>
|
|
{% endfor -%}
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{%- endif -%}
|
|
{% else %}
|
|
{%- set p = get_page(path=link) -%}
|
|
{%- if not p.extra.hide -%}
|
|
<a href="{{ p.permalink }}" class="item
|
|
{%- if current_path %}{% if current_path == p.path %} active{% endif %}{% endif -%}
|
|
"><div>{{p.title}}</div></a>
|
|
{%- endif -%}
|
|
{% endif %}
|
|
{% endfor %}
|
|
</span>
|
|
|
|
</nav> |