Add an element on the last Jekyll loop of posts : <p>I'm sure this is simple but cant find the answer.</p>

<p>There is a standard Jekyll/Liquid post iterator. How do i use the <code>{% if %}</code> statement below to put the <code>&lt;hr&gt;</code> element for each post <strong>except</strong> the last?</p>

<pre><code>&lt;ul class="post-list"&gt;
    {% for post in site.posts %}
      {% if post.url %}
      &lt;br&gt;
        &lt;li&gt;
          &lt;h2&gt;
            &lt;a class="post-link" href="{{ post.url | prepend: site.baseurl }}"&gt;{{ post.title }}&lt;/a&gt;
          &lt;/h2&gt;
          &lt;span class="post-meta"&gt;{{ post.date | date: "%b %-d, %Y" }}&lt;/span&gt;
        &lt;/li&gt;

        **** {% if post != $last %} ***** How do i do this??
          &lt;hr&gt;
        {% endif %}
      {% endif %}
    {% endfor %}
  &lt;/ul&gt;
</code></pre>
