Short version:
I want to add 1 to a number in a liquid template and use the result as an array index.
{% capture plus_one %}{{ 0 | plus: 1 }}{% endcaptur
assign preserves the number:
assign
{% for item in items %} {% assign next_i = forloop.index0 | plus: 1 %} {% assign prev_i = forloop.index0 | minus: 1 %} {{ items[next_i] }} {{ items[prev_i] }} {% endfor %}