Jinja allows me to do
{% for item in all_items %}
{{ item }}
{% endfor %}
but I'd like to be able to only take the first n items; in Python that would be
for item in all_items[:n]:
Is there any elegant way to do this in Jinja, except
{% for item in all_items %}
{% if loop.index <= n %}
{{ item }}
{% endif %}
{% endfor %}