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