Created
July 14, 2013 20:21
-
-
Save phirefly/5995809 to your computer and use it in GitHub Desktop.
Jekyll: generate pages by weight (1..10) and group 'topnavigation'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <ul id="top-nav"> | |
| {% for weight in (1..10) %} | |
| {% for node in site.pages %} | |
| {% if node.group == 'topnavigation' %} | |
| {% if node.weight == weight %} | |
| {% if page.url == node.url %} | |
| <li class="active"><a href="{{site.baseurl}}{{node.url}}" class="active">{{node.title}}</a></li> | |
| {% else %} | |
| <li><a href="{{site.baseurl}}{{node.url}}" class="active">{{node.title}}</a></li> | |
| {% endif %} | |
| {% endif %} | |
| {% endif %} | |
| {% endfor %} | |
| {% endfor %} | |
| </ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment