<%
page.layout = "archive"
page.title = theme.archive.title || __('archive.title')
page.subtitle = theme.archive.subtitle || __('archive.subtitle')
page.banner_img = theme.archive.banner_img
page.banner_img_height = theme.archive.banner_img_height
page.banner_mask_alpha = theme.archive.banner_mask_alpha
var date_cursor = 'xxx'
%>

<div class="list-group">
  <p class="h4"><%= __('postTotal', site.posts.length) %></p>
  <hr>
  <% page.posts.each(function (post) { %>
    <% if(date(post.date, "YYYY") != date_cursor) { %>
      <% date_cursor = date(post.date, "YYYY") %>
      <p class="h5"><%= date_cursor %></p>
    <% } %>
    <a href="<%- url_for(post.path) %>" class="list-group-item list-group-item-action">
      <span class="archive-post-title"><%= post.title %></span>
      <span style="float: right;"><%- date(post.date, "MM-DD") %></span>
    </a>
  <% }) %>
</div>
<%- partial('_partial/paginator') %>
