-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcategory.ftl
60 lines (55 loc) · 2.37 KB
/
category.ftl
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<#include "module/macro.ftl">
<@layout title="${category.name} - ${blog_title!}">
<main>
<div class="wrap min">
<section class="home-title">
<h1>"${category.name}"</h1>
<span>${category.description!}</span>
</section>
<#-- 文章列表 -->
<section class="home-posts">
<#list posts.content as post>
<div class="post-item">
<h2>
<a href="${post.fullPath!}">${post.title}</a>
</h2>
<p> ${post.summary!} </p>
<div class="post-meta">
<time class="date">${post.createTime?string["yyyy.MM.dd"]!}</time>
<#if (post.categories)?? && post.categories?size !=0>
<#list post.categories as categorie>
<span class="category">${categorie.name!}</span>
</#list>
</#if>
<span class="comments">${post.commentCount!} ℃</span>
</div>
</div>
</#list>
</section>
<#-- 分页 -->
<section class="page-navigator">
<#if posts.totalPages gt 1>
<@paginationTag method="categoryPosts" slug="${category.slug!}" page="${posts.number}" total="${posts.totalPages}" display="3">
<#if pagination.hasPrev>
<a class="extend prev" rel="prev" href="${pagination.prevPageFullPath!}">«</a>
</#if>
<#list pagination.rainbowPages as number>
<#if number.isCurrent>
<span class="page-number current">${number.page!}</span>
<#else>
<a class="page-number" href="${number.fullPath!}">${number.page!}</a>
</#if>
</#list>
<#if pagination.hasNext>
<a class="extend next" rel="next" href="${pagination.nextPageFullPath!}">
»
</a>
</#if>
</@paginationTag>
<#-- <#else>
<span>当前只有一页</span> -->
</#if>
</section>
</div>
</main>
</@layout>