1
0
mirror of https://github.com/avitex/avitex.github.io synced 2024-11-16 09:29:57 +00:00
1bit.pw/templates/partials/site-nav.html
2020-04-14 12:23:38 +10:00

30 lines
1.2 KiB
HTML

<nav class="site-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
<ul class="menu main-menu">
{% for item in config.extra.main_menu %}
<li>
<a itemprop="url"
class="{% if macros::is_active_nav(url=macros::link(url=item.url), curr_url=current_url) == "true" %}active{% endif %}"
href="{{ macros::link(url=item.url) }}">
<span itemprop="name">{{ item.name }}</span>
</a>
</li>
{% endfor %}
</ul>
{% for item in config.extra.main_menu %}
{% if item.sub and current_url is starting_with(macros::link(url=item.url)) %}
<ul class="menu sub-menu">
{% for sub_item in item.sub %}
<li>
<a
itemprop="url"
href="{{ macros::link(url=sub_item.url) }}"
{%- if macros::link(url=sub_item.url) == current_url %} class="active" {% endif -%}
>
<span itemprop="name">{{ sub_item.name }}</span>
</a>
</li>
{% endfor %}
</ul>
{% endif %}
{% endfor %}
</nav>