<section class="archive">
  <% 
  var groupPosts = _.groupBy(page.posts.data, function (post) {
    return post.date.format('YYYY');
  });
  groupPosts = _.reduce(groupPosts, function (result, posts, year) {
    return result.concat({
      posts: _.orderBy(posts, function (post) {
        return post.date;
      }, 'desc'),
      year: year,
    })
  }, []);
  groupPosts = _.orderBy(groupPosts, 'year', 'desc');
  %>
  <% _.forEach(groupPosts, function (group) { %>
    <section class="archive-category">
      <h1 class="title"><%= group.year %></h1>
      <ul class="menu">
        <% _.forEach(group.posts, function(item) { %>
          <li>
            <a href="<%- url_for(item.path) %>"><%= item.title %></a>
            <span class="date"><%- date(item.date, 'MMM D, YYYY') %></span>
          </li>
        <% }); %>
      </ul>
    </section>
  <% }); %>
</section>
<%- partial('_partial/pagination') %>