increment
Creates and outputs a new number variable with initial value 0. On subsequent calls, it increases its value by one and outputs the new value.
Variables created using increment are independent from variables created using assign or capture.
Example:
liquid
{% increment my_counter %}
{% increment my_counter %}
{% increment my_counter %}
1
2
3
2
3
Output
html
1
2
3
1
2
3
2
3