feat:增加近期更新的列表,默认10条。
This commit is contained in:
		
							
								
								
									
										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