hexo-theme-keep/layout/home-content.ejs

51 lines
2.0 KiB
Plaintext
Raw Normal View History

<div class="home-content-container fade-in-down-animation">
<ul class="home-article-list">
<% page.posts.forEach(post => { %>
<li class="home-article-item">
<h3 class="home-article-title">
<a href="<%- url_for(post.path) %>">
2020-04-29 10:44:47 +08:00
<% if (post.top) { %>
<i class="fa fa-thumb-tack"></i>
<% } %>
<%= post.title %>
2020-04-13 18:27:16 +08:00
</a>
</h3>
2020-04-03 18:18:42 +08:00
<div class="home-article-content markdown-body">
<% if (post.excerpt) { %>
<%- post.excerpt %>
<% } else { %>
<%- truncate(strip_html(post.content), {length: 150}) %>
<% } %>
</div>
<div class="home-article-meta-info">
<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>
<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
<% } %>
</div>
<% if (theme.magic.enable === false) { %>
<hr>
<% } %>
<a href="<%- url_for(post.path) %>"><%- __('read_more') %> <i class="fa fa-angle-right"></i></a>
</div>
</li>
<% }) %>
</ul>
<div class="home-paginator">
<%- partial('_partial/paginator', {pageObject: page}) %>
</div>
</div>