javascript - Swig - for loop sequence -
i using swig in gulp. swig port of twig. iterate on sequence of digits in swig for-loop. like:
{% x in 1..10 %} <img src="image{{ x }}.jpg" /> {% endfor %} my current workaround declare:
{% set pictures = [1,2,3,4,5,6] %} {% x in picture %} <img src="image{{ x }}.jpg" /> {% endfor %} there must better way :)
Comments
Post a Comment