<%= __('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 %>
<%= post.date.format('MM-DD') %>
<% if (post.categories && post.categories.length) { %>
·
<% post.categories.forEach(function(cat, catIndex) { %>
<%= cat.name %>
<% }); %>
<% } %>
chevron_right
<% }); %>
<% }); %> <% if (!site.posts || site.posts.length === 0) { %>
article
<%= __('diary.no_articles') %>
<%= __('diary.no_articles_desc') %>
<% } %>