Files
2013-08-24 00:29:22 +08:00

48 lines
1.7 KiB
Plaintext

<%
var title = '';
if (page.category) title += __('category', page.category);
if (page.tag) title += __('tag', page.tag);
if (page.archive){
if (page.year) title += __('archive_b', page.year + (page.month ? '/' + page.month : ''));
else title += __('archive_a');
}
%>
<header id="archive-header">
<h1 class="alignleft"><%= title %></h1>
<div class="search alignright">
<form action="http://google.com/search" method="get" accept-charset="utf-8">
<input type="search" name="q" results="0" placeholder="<%= __('search') %>">
<input type="hidden" name="q" value="site:<%- config.url.replace(/^https?:\/\//, '') %>">
</form>
</div>
</header>
<% if (pagination == 2){ %>
<% page.posts.each(function(item){ %>
<%- partial('article', {item: item, index: true}) %>
<% }); %>
<%- partial('pagination') %>
<% } else { %>
<% var this_year; %>
<% page.posts.each(function(item){ %>
<% var year = item.date.year(); %>
<% if (this_year != year || !this_year){ %>
<% this_year = year; %>
</section><section class="archives"><div class="year"><%= year %></div>
<% } %>
<article class="archive">
<h1 class="title"><a href="<%- config.root %><%- item.path %>"><%= item.title %></a></h1>
<footer>
<time datetime="<%= item.date.toDate().toISOString() %>"><%= item.date.format('MMM D') %></time>
<% if (item.categories.length){ %>
<span class="cats"><%- partial('post/taxonomy', {taxonomy: item.categories, separator: ', '}) %></span>
<% } %>
<% if (item.tags.length){ %>
<span class="tags"><%- partial('post/taxonomy', {taxonomy: item.tags, separator: ', '}) %></span>
<% } %>
</footer>
</article>
<% }); %>
<% } %>