<% } %>
% function buildArchive(posts, year, month = null) { const time = moment([page.year, page.month ? page.month - 1 : null].filter(i => i !== null)); %>
<% } if (!page.year) { let years = {}; page.posts.each(p => years[p.date.year()] = null); for (let year of Object.keys(years).sort((a, b) => b - a)) { let posts = page.posts.filter(p => p.date.year() == year); %> <%- buildArchive(posts, year, null) %> <% } } else { %> <%- buildArchive(page.posts, page.year, page.month) %> <% } %> <% if (page.total > 1) { %> <%- _partial('common/paginator') %> <% } %>