<% var title = ''; var posts = site.posts; if (page.category) { title = page.category; posts = page.posts; } if (page.tag) { title = page.tag; posts = page.posts; } if (page.archive){ if (page.year) title = page.year + (page.month ? '/' + page.month : ''); else { title = __('archive_a'); posts = site.posts; } } var year, month; var last_year = 1970; var is_first_year = 1; %>
<% if (theme.widgets.length) { %>
<% } else { %>
<% } %>
<% posts.sort('date', -1).each(function(item){ %> <% year = item.date.toDate().getFullYear(); month = item.date.toDate().getMonth(); %> <% if (year != last_year){ %> <% if (!is_first_year) { %> <% } %> <% is_first_year = 0 %>

<%= year %>

<% if (theme.widgets.length) { %> <%- partial('sidebar') %> <% } %>