Skip to content

Instantly share code, notes, and snippets.

@sskylar
Last active November 1, 2016 15:57
Show Gist options
  • Save sskylar/ce0bef39fea6dbfd64d7811e642bc56c to your computer and use it in GitHub Desktop.
Save sskylar/ce0bef39fea6dbfd64d7811e642bc56c to your computer and use it in GitHub Desktop.
Custom nested menu for Jekyll/Siteleaf
menu:
- title: Home
url: /
- title: About
url: /about
children:
- title: Contact
url: /about/contact
- title: Team
url: /about/team
- title: Follow us
url: http://facebook.com/...
<ul>
{% for item in include.menu %}
<li>
<a href="{{item.url}}">{{item.title}}</a>
{% if item.children.size > 0 %}{% include menu.html menu=item.children %}{% endif %}
</li>
{% endfor %}
</ul>
{% include menu.html menu=site.menu %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment