Skip to content

Instantly share code, notes, and snippets.

@stevetrask
Last active May 31, 2017 22:10
Show Gist options
  • Save stevetrask/09b1ab5b269999ec844d8c77c2db81e4 to your computer and use it in GitHub Desktop.
Save stevetrask/09b1ab5b269999ec844d8c77c2db81e4 to your computer and use it in GitHub Desktop.
<nav>
<ul>
<li class="c-nav_logo">
<a href="/"><img src="/img/logo-lrg.svg" alt="logo" /></a>
</li>
{% for nav in site.data.navigation %}
{% if nav.children != null %}
<li class="c-nav_dropdown-trigger">
<a href="{{ nav.href }}">{{ nav.title }}</a>
<ul class="c-nav_dropdown">
{% for child in nav.children %}
<li>
<a href="{{ child.child_href }}">
{{ child.child_title }}
<span>{{ child.child_desc }}</span>
</a>
</li>
{% endfor %}
</ul>
{% else %}
<li>
<a href="{{ nav.href }}">{{ nav.title }}</a>
{% endif %}
</li>
{% endfor %}
</ul>
</nav>
# Link structure for the navigation
- title: Link Name
href: /link-url/
children:
- child_title: Child Link Name
child_href: /link-url/child-link/
child_desc: Desc micro copy line
- child_title: Child Link Name
child_href: /link-url/child-link/
child_desc: Desc micro copy line
- title: Link Name
href: /link-url/
children:
- child_title: Child Link Name
child_href: /link-url/child-link/
child_desc: Desc micro copy line
- child_title: Child Link Name
child_href: /link-url/child-link/
child_desc: Desc micro copy line
- title: Link Name
href: /link-url/
children:
- child_title: Child Link Name
child_href: /link-url/child-link/
child_desc: Desc micro copy line
- child_title: Child Link Name
child_href: /link-url/child-link/
child_desc: Desc micro copy line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment