for loop last item
Use forloop.last to select the last item in the for loop.
<ul>
{% for page in site.pages %}
<li>
<a title="{{ page.title }}" href="{{ page.url }}">{{ page.title }}{% if forloop.last == true %} - last item{% endif %}</a>
</li>
{% endfor %}
</ul>
copy