Skip to content

Instantly share code, notes, and snippets.

@winzard
Created May 23, 2017 13:11
Show Gist options
  • Select an option

  • Save winzard/f34b3397d188a6ed9fd13d1f187d2024 to your computer and use it in GitHub Desktop.

Select an option

Save winzard/f34b3397d188a6ed9fd13d1f187d2024 to your computer and use it in GitHub Desktop.
{% menu main %}
{% for item in menuitems %}
<li class="site-main-nav__item {% if item.submenu %} site-main-nav__item--dropdown js-hover-dropdown-parent{% endif %} {% if item.current %}is-active{% endif %}">
{% if item.submenu %}
<span class="site-main-nav__item-text js-hover-dropdown-trigger">{{ item.title }}</span>
<div class="dropdown js-hover-dropdown">
<ul class="dropdown__list">
{% for sub in item.submenu %}
<li>
<a class="dropdown__item-text {% if sub.current %}is-active{% endif %}" href="{{ sub.url }}">{{ sub.title }}</a>
</li>
{% endfor %}
</ul>
</div>
{% else %}
<a class="site-main-nav__item-text" href="{{ item.url }}">{{ item.title }}</a>
{% endif %}
</li>
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment