<% page.robots = 'noindex,follow'; if (page.menu_id == undefined) { page.menu_id = 'post'; } if (page.author) { page.header = false; } function layoutArchiveList() { var el = '' if (page.author) { page.title = page.author.name el += partial('_partial/main/navbar/author_banner') } else { page.title = __('btn.archives') el += partial('_partial/main/navbar/nav_tabs_blog') } el += `
` var years = [] const posts = page.author != null ? site.posts.filter(p => (p.author || theme.default_author.name) == page.author.name) : site.posts posts.sort('date', -1).each(function(post) { post.year = date(post.date, 'YYYY') if (post.year && (years.includes(post.year) == false) && (post.title || post.date)) { years.push(post.year) } }) for (let year of years) { el += `
` el += `
${year}
` posts.sort('date', -1).filter(function (post) { post.year = date(post.date, 'YYYY') return post.year == year }).each(function(post) { el += `` }) el += `
` } el += `
` return el } function layoutDiv() { if (page.posts && (is_category() || is_tag())) { return partial('index') } else { return layoutArchiveList() } } %> <%- layoutDiv() %>