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

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -