Skip to content

Instantly share code, notes, and snippets.

@bobdenotter
Created February 18, 2013 19:42
Show Gist options
  • Save bobdenotter/4980044 to your computer and use it in GitHub Desktop.
Save bobdenotter/4980044 to your computer and use it in GitHub Desktop.
Bolt: When looping over an array to create a list, give the <li> classes like 'first', 'last', 'odd' and 'even'.
<ul>
{% for record in records %}
<li class="{% if loop.first %}first {% endif %}{% if loop.last %}last {% endif %} {{ cycle(["even", "odd"], loop.index) }}">
<a href="{{ record.link }}">{{ record.title }}</a>
</li>
{% endfor %}
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment