{% for post in site.posts %} {% capture modulo %}{{ forloop.index0 | modulo:2 }}{% endcapture %} {% endfor %}