-
Notifications
You must be signed in to change notification settings - Fork 16
/
header-primary-navigation.html
28 lines (25 loc) · 1.23 KB
/
header-primary-navigation.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{% set selected_nav = data.nav.entries|selectattr("id", "equalto", section_id)|first %}
<li class="dropdown primary-nav__item_desktop" role="menuitem">
<a href="#" data-toggle="dropdown" class="dropdown__trigger nav-bar__link label" id="action-menu-{{ selected_nav.id }}" role="button" aria-haspopup="true" aria-expanded="false" role="menuitem">
{{ selected_nav.label }}
{% if selected_nav.feather %}
<span data-feather="{{ selected_nav.feather }}" aria-hidden="true"></span>
{% endif %}
<span data-feather="chevron-down" aria-hidden="true"></span>
</a>
<ul class="dropdown__menu" aria-labelledby="action-menu-{{ selected_nav.id }}" role="menu" aria-label="{{ selected_nav.label }}">
{% for entry in selected_nav.entries %}
{% set url = entry.url %}
{% set urlAttrs = 'rel="noopener" target="_blank"' %}
{% if entry.route %}
{% set url = url_for(entry.route) %}
{% set urlAttrs = "" %}
{% endif %}
<li>
<a {{ urlAttrs }} href="{{ url }}" class="dropdown__link" role="menuitem">
{{ entry.label }}
</a>
</li>
{% endfor %}
</ul>
</li>