-
-
Notifications
You must be signed in to change notification settings - Fork 178
Expand file tree
/
Copy patharchive.ejs
More file actions
40 lines (38 loc) · 1.43 KB
/
archive.ejs
File metadata and controls
40 lines (38 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<%
var title = '';
if (page.category) title = page.category;
if (page.tag) title = page.tag;
if (page.archive){
if (page.year) title = page.year + (page.month ? '/' + page.month : '');
else title = __('archive_a');
}
%>
<h2 class="archive-title<% if (page.tag){ %> tag<% } else if (page.category){ %> category<% } %>"><%= title %></h2>
<% if (pagination == 2){ %>
<% page.posts.each(function(item){ %>
<%- partial('article', {item: item, index: true}) %>
<% }); %>
<%- partial('pagination') %>
<% } else { %>
<div class="archive">
<% page.posts.each(function(item){ %>
<article class="<%= item.layout %>">
<div class="post-content">
<header>
<div class="icon"></div>
<time datetime="<%= item.date.toDate().toISOString() %>"><a href="<%- config.root %><%- item.path %>"><%= item.date.format(config.date_format) %></a></time>
<% if (item.link){ %>
<% if (item.title){ %>
<h1 class="title link"><a href="<%- item.link %>" target="_blank"><%= item.title %></a></h1>
<% } else { %>
<h1 class="title link"><a href="<%- item.link %>" target="_blank"><%= item.link %></a></h1>
<% } %>
<% } else { %>
<h1 class="title"><a href="<%- config.root %><%- item.path %>"><%= item.title %></a></h1>
<% } %>
</header>
</div>
</article>
<% }); %>
</div>
<% } %>