Last active
June 25, 2017 02:25
-
-
Save cherihung/bbaf486e7579ce1c922f621e8a10ceca to your computer and use it in GitHub Desktop.
for jekyll templates - determine if item in menu is the current one navigated to
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
{% for item in sorted_items %} | |
{% assign current = nil %} | |
{% if page.id == item.url %} | |
{% assign current = 'currentItem' %} | |
{% endif %} | |
<li class="{{current}}"><a href="{{item.url}}"><img src="{{item.imageId}}.jpg" /></a></li> | |
{% endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment