I'm trying to use the jinja2 templating langauge to return the last n(say, 5) posts in my posts list:
{% for recent in site.posts|reverse|slice(5) %}
{% for post in recent %}
<li> <a href="/{{ post.url }}">{{ post.title }}</a></li>
{% endfor %}
{% endfor %}
This is returning the whole list though. How do you strip the first or last n elements?