title: Liquid templates: even/odd items in for loop
body: <p>If I have a for loop in Liquid (using Jekyll), how can I target even (or odd) items only? I have tried:</p>
  
  <pre><code>{% for item in site.posts %}
      {% if forloop.index % 2 == 1 %}
  </code></pre>
  
  <p>but that doesn't seem to work. I have also tried:</p>
  
  <pre><code>(forloop.index % 2) == 1
  </code></pre>
  
  <p>and:</p>
  
  <pre><code>forloop.index - (forloop.index / 2 * 2) == 1
  </code></pre>