diff --git a/themes/yilia/layout/_partial/archive.ejs b/themes/yilia/layout/_partial/archive.ejs index 9f8226c..5238781 100644 --- a/themes/yilia/layout/_partial/archive.ejs +++ b/themes/yilia/layout/_partial/archive.ejs @@ -1,16 +1,14 @@ -<% if (pagination == 2){ %> - <% page.posts.each(function(post){ %> +<% if (pagination == 2){ + page.posts.each(function(post){ %> <%- partial('article', {post: post, index: true}) %> - <% }) %> -<% } else { %> - <% var last; %> - <% page.posts.each(function(post, i){ %> - <% var year = post.date.year(); %> - <% if (last != year){ %> - <% if (last != null){ %> - - <% } %> - <% last = year; %> + <% }) + } else { + var last; + page.posts.each(function(post, i){ + var year = post.date.year(); + if (last != year){ + if (last != null){ %><% } + last = year; %>
<%= year %> @@ -18,12 +16,9 @@
<% } %> <%- partial('archive-post', {post: post, even: i % 2 == 0}) %> - <% }) %> - <% if (page.posts.length){ %> -
- <% } %> -<% } %> -<% if (page.total > 1){ %> + <% }) + if (page.posts.length){ %><% }} + if (page.total > 1){ %>