feat:增加近期更新的列表,默认10条。
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
<% if (!is_home()) { %>
|
||||
<li><a href="/index.html">返回首页</a></li>
|
||||
<% } %>
|
||||
<li<% if (is_current('/recently')) { %> class="uk-active"<% } %>><a href="/recently">近期更新</a></li>
|
||||
<li<% if (is_current('/categories')) { %> class="uk-active"<% } %>><a href="/categories">知识分类</a></li>
|
||||
<li<% if (is_current('/tags')) { %> class="uk-active"<% } %>><a href="/tags">知识标签</a></li>
|
||||
<li<% if (is_archive()) { %> class="uk-active"<% } %>><a href="/archives">归档文章</a></li>
|
||||
@@ -23,6 +24,7 @@
|
||||
<% if (!is_home()) { %>
|
||||
<li><a href="/index.html">返回首页</a></li>
|
||||
<% } %>
|
||||
<li<% if (is_current('/recently')) { %> class="uk-active"<% } %>><a href="/recently">近期更新</a></li>
|
||||
<li<% if (is_current('/categories')) { %> class="uk-active"<% } %>><a href="/categories">知识分类</a></li>
|
||||
<li<% if (is_current('/tags')) { %> class="uk-active"<% } %>><a href="/tags">知识标签</a></li>
|
||||
<li<% if (is_archive()) { %> class="uk-active"<% } %>><a href="/archives">归档文章</a></li>
|
||||
|
@@ -1,4 +1,4 @@
|
||||
<% page.posts.sort("date", "desc" ).each(function(post, i) { %>
|
||||
<% page.posts.sort("date", "desc").each(function(post, i) { %>
|
||||
<div class="uk-card uk-card-default uk-card-small uk-width-1-1 mb-2">
|
||||
<div class="uk-card-header">
|
||||
<h3 class="uk-card-title">
|
||||
|
43
themes/grid/layout/partial/post/update-list.ejs
Normal file
43
themes/grid/layout/partial/post/update-list.ejs
Normal file
@@ -0,0 +1,43 @@
|
||||
<% site.posts.sort("updated", "desc").slice(0, config.recent_per_page).each(function(post, i) { %>
|
||||
<div class="uk-card uk-card-default uk-card-small uk-width-1-1 mb-2">
|
||||
<div class="uk-card-header">
|
||||
<h3 class="uk-card-title">
|
||||
<a href="/<%= post.path %>">
|
||||
<%= post.title %>
|
||||
</a>
|
||||
</h3>
|
||||
<div class="flex row-a col-n rm-start-a">
|
||||
<div class="uk-text-meta mr-1">发布:<%= date(post.date, "YYYY-MM-DD HH:mm") %></div>
|
||||
<% const updateValid = post.updated.isValid() %>
|
||||
<div class="uk-text-meta mr-1">更新:<%= date(updateValid ? post.updated : post.date, "YYYY-MM-DD HH:mm") %></div>
|
||||
<% if (post.categories.length> 0) { %>
|
||||
<div class="uk-text-meta">知识分类:
|
||||
<%- list_categories(post.categories, {
|
||||
class: { a: 'uk-link-muted' },
|
||||
show_count: false,
|
||||
style: false,
|
||||
separator: ' / '
|
||||
}) %>
|
||||
</div>
|
||||
<% } %>
|
||||
</div>
|
||||
</div>
|
||||
<% if (post.excerpt) { %>
|
||||
<div class="uk-card-body">
|
||||
<%- post.excerpt %>
|
||||
</div>
|
||||
<% } %>
|
||||
<% if (post.tags.length> 0) { %>
|
||||
<div class="uk-card-footer flex row-a rm-start-a hin">
|
||||
<div class="tag-title">分类标签:</div>
|
||||
<div class="flex row-a rm-start-a w-wrap-a extend-1-a">
|
||||
<% post.tags.each(function(tag) { %>
|
||||
<span class="uk-label ml-1 mb-1 <% if (is_tag(tag.name)) { %>uk-label-warning<% } %>">
|
||||
<%= tag.name %>
|
||||
</span>
|
||||
<% }) %>
|
||||
</div>
|
||||
</div>
|
||||
<% } %>
|
||||
</div>
|
||||
<% }) %>
|
Reference in New Issue
Block a user