Last active
August 29, 2015 13:58
-
-
Save vegetableman/9953330 to your computer and use it in GitHub Desktop.
liquid template - contains, assign, split, append, forloop.index0
This file contains 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 img_dir in site.imagemap %} | |
{% if img_dir.size > 0 %} | |
{% assign img_category_arr = (img_dir[0] | split: '-') %} | |
{% assign img_category = img_category_arr[1] %} | |
{% for img_item in img_dir[1]%} | |
{% if img_item contains 'main' %} | |
{% assign img_path = (img_dir[0]|append: '/'|append: img_item) %} | |
{% picture {{img_path}} data-category="{{img_category}}" data-index="{{forloop.index0}}" %} | |
{% endif %} | |
{% endfor %} | |
{% endif %} | |
{% endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment