<% if (is_archive()){ %>
  <div class="archives-tags-wrap"><blockquote><span><%= __('post_total_count', site.posts.length) %></span></blockquote>
<% } %>

<% if (is_current("archives/", true)){ %>

	<!-- 完全显示 -->
	<% var last; %>
	<% site.posts.sort('-date').map(function(post, i){ %>
		<% var year = post.date.year(); %>
		<% if (last != year){ %>
		  <% if (last != null){ %>
		    </div></section>
		  <% } %>
		  <% last = year; %>
		  <section class="archives-wrap">
		    <div class="archive-year-wrap">
		      <h1><a href="<%- url_for(config.archive_dir + '/' + year) %>" class="archive-year"><%= year %></a></h1>
		    </div>
		    <div class="archives">
		<% } %>
		<%- partial('_partial/archive-post', {post: post, even: i % 2 == 0, index: true}) %>
	<% }) %>

	<% if (site.posts.length){ %>
		</div></section>
	<% } %>
<% } else { %>

	<!-- 分页显示 -->
	<% var last; %>
	<% page.posts.each(function(post, i){ %>
		<% var year = post.date.year(); %>
		<% if (last != year){ %>
		  <% if (last != null){ %>
		    </div></section>
		  <% } %>
		  <% last = year; %>
		  <section class="archives-wrap">
		    <div class="archive-year-wrap">
		      <h1><a href="<%- url_for(config.archive_dir + '/' + year) %>" class="archive-year"><%= year %></a></h1>
		    </div>
		    <div class="archives">
		<% } %>
		<%- partial('_partial/archive-post', {post: post, even: i % 2 == 0, index: true}) %>
	<% }) %>
	<% if (page.posts.length){ %>
		</div></section>
	<% } %>

	<!-- 页数指示器 -->
	<% if (page.total > 1){ %>
	  <nav id="page-nav">
	    <% var prev_text = __('prev');var next_text = __('next')%>
	    <%- paginator({
	      prev_text: prev_text,
	      next_text: next_text
	    }) %>
	  </nav>
	<% } %>
<% } %>


