<%= __('diary.title') %> <%= __('diary.total') %> <%= site.posts.length %> <%= __('diary.articles') %> <% const postsByYear = {}; site.posts.sort('-date').each(function(post) { const year = post.date.year(); if (!postsByYear[year]) { postsByYear[year] = []; } postsByYear[year].push(post); }); %> <% Object.keys(postsByYear).sort().reverse().forEach(function(year) { %>
calendar_today
<%= year %> <%= __('diary.year') %> <%= postsByYear[year].length %> <%= __('diary.articles') %>
<% postsByYear[year].forEach(function(post, index) { %> article
<%= post.title %>
chevron_right
<% }); %>
<% }); %> <% if (!site.posts || site.posts.length === 0) { %>
article
<%= __('diary.no_articles') %> <%= __('diary.no_articles_desc') %>
<% } %>