2020-04-01 12:09:06 +08:00
|
|
|
<div class="home-content-container">
|
2020-04-01 15:28:01 +08:00
|
|
|
<ul class="home-article-list">
|
|
|
|
<% page.posts.forEach(post => { %>
|
|
|
|
<li class="home-article-item">
|
2020-04-24 22:49:10 +08:00
|
|
|
|
2020-04-01 16:41:30 +08:00
|
|
|
<h3 class="home-article-title">
|
2020-04-24 22:49:10 +08:00
|
|
|
<a href="<%- url_for(post.path) %>">
|
2020-04-13 18:27:16 +08:00
|
|
|
<%= (post.top ? `[${__('top')}] ` : '') + post.title %>
|
|
|
|
</a>
|
2020-04-01 16:41:30 +08:00
|
|
|
</h3>
|
2020-04-01 10:14:18 +08:00
|
|
|
|
2020-04-03 18:18:42 +08:00
|
|
|
<div class="home-article-content markdown-body">
|
2020-04-01 16:41:30 +08:00
|
|
|
<% if (post.excerpt) { %>
|
|
|
|
<%- post.excerpt %>
|
|
|
|
<% } else { %>
|
|
|
|
<%- truncate(strip_html(post.content), {length: 150}) %>
|
|
|
|
<% } %>
|
2020-04-01 10:14:18 +08:00
|
|
|
</div>
|
|
|
|
|
2020-04-01 15:28:01 +08:00
|
|
|
<div class="home-article-meta-info">
|
2020-04-24 22:49:10 +08:00
|
|
|
<div class="article-date">
|
|
|
|
<span><i class="fa fa-pencil-square-o"></i> <%= date(post.date, 'YYYY-MM-DD') %></span>
|
2020-04-26 18:34:51 +08:00
|
|
|
<% if (theme.magic.enable === true) { %>
|
|
|
|
<span>
|
2020-04-24 22:49:10 +08:00
|
|
|
<i class="fa fa-folder"></i>
|
|
|
|
<ul>
|
|
|
|
<% post.categories.forEach((category, i) => { %>
|
|
|
|
<li><%= i === 0 ? '' : '| ' %><a
|
|
|
|
href="<%- url_for(category.path) %>"><%= category.name %></a></li>
|
|
|
|
<% }); %>
|
|
|
|
</ul>
|
|
|
|
</span>
|
2020-04-26 18:34:51 +08:00
|
|
|
<% } %>
|
2020-04-24 22:49:10 +08:00
|
|
|
</div>
|
|
|
|
<% if (theme.magic.enable === false) { %>
|
|
|
|
<hr>
|
|
|
|
<% } %>
|
2020-04-25 10:21:09 +08:00
|
|
|
<a href="<%- url_for(post.path) %>"><%- __('read_more') %> <i class="fa fa-angle-right"></i></a>
|
2020-04-01 15:28:01 +08:00
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
<% }) %>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<div class="paginator">
|
|
|
|
<% if (page.prev) { %>
|
|
|
|
<a class="prev btn"
|
|
|
|
href="<%- url_for(page.prev == 1 ? '' : '/page/' + page.prev) %>"
|
|
|
|
><%- __('prev') %></a>
|
|
|
|
<% } %>
|
|
|
|
|
|
|
|
<% if (page.next) { %>
|
|
|
|
<a class="next btn"
|
|
|
|
href="<%- url_for('/page/' + page.next) %>"
|
|
|
|
><%- __('next') %></a>
|
|
|
|
<% } %>
|
2020-04-01 10:14:18 +08:00
|
|
|
</div>
|
2020-04-01 15:28:01 +08:00
|
|
|
</div>
|