<% if (pagination == 2){ %>
  <% page.posts.each(function(post){ %>
    <%- partial('article', {post: post, index: true}) %>
  <% }) %>
<% } else { %>
  <% var last; %>
  <% page.posts.each(function(post, i){ %>
    <% var year = post.date.year(); %>
    <% if (last != year){ %>
      <% if (last != null){ %>
        </div></section>
      <% } %>
      <% last = year; %>
      <div class="row" style="padding-top:30px">
        <div class="col s12">
          <h3><a href="<%- url_for(config.archive_dir + '/' + year) %>"><%= year %></a></h3>
        </div>
    <% } %>
    <div class="col s12 m6 l6"> 
    <%- partial('archive-post', {post: post, even: i % 2 == 0}) %>
    </div>
  <% }) %>
  <% if (page.posts.length){ %>
    </div>
  <% } %>
<% } %>
<% if (page.total > 1){ %>
  <div class="row">
    <div class="col s12 center">
      <ul class="pagination">
        <%- paginator({
          prev_text: '<i class="material-icons">chevron_left</i>',
          next_text: '<i class="material-icons">chevron_right</i>'
        }) %>
      </ul>
    </div>
  </div>
<% } %>