How get ints in Jekyll? -


i trying make blog , want make id tags correspond each time loop runs (e.g. #section_1, #section_2,#section_(insert variable) ).

is there way in jekyll?

this should produce you're looking for:

{% assign indices = "1|2|3" | split: "|" %} {% index in indices %}     <div id="{{ index }}">this div {{ index }}</div> {% endfor %} 

you'll have know in advance how many sections want created, , add each id 1|2|3 bit in first line.


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

java.lang.NoClassDefFoundError When Creating New Android Project -

Decoding a Python 2 `tempfile` with python-future -