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 - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

python - malformed header from script index.py Bad header -