-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy patharchives.ftl
41 lines (41 loc) · 2.27 KB
/
archives.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
<#include "template/layout.ftl">
<@layout title="归档 - ${blog_title!}" canonical="${archives_url!}">
<#if (archives)?? && archives?size gt 0>
<#list archives as archive>
<div class="card card-content">
<div class="timeline-title">${archive.year?c}</div>
<div class="timeline">
<#list archive.posts as post>
<#assign thumbnail = (post.thumbnail?? && post.thumbnail!='')?then(post.thumbnail!, (settings.default_thumbnail?? && settings.default_thumbnail!='')?then(settings.default_thumbnail + settings.default_thumbnail?contains('?')?then("&","?") + "postId=" + post.id?c, ''))>
<article class="media">
<#if thumbnail!=''>
<a href="${post.fullPath}" class="media-left">
<img class="not-gallery" src="${thumbnail!}" alt="${post.title!}">
</a>
</#if>
<div class="media-content">
<time datetime="${post.createTime!}">${post.createTime?string('yyyy-MM-dd')}</time>
<a href="${post.fullPath!}" class="title has-link-grey">${post.title!}</a>
<#if post.categories?? && post.categories?size gt 0>
<p>
<#list post.categories as category>
<a class="has-link-grey"
href="${category.fullPath!}">${category.name!}</a>
</#list>
</p>
</#if>
</div>
</article>
</#list>
</div>
</div>
</#list>
<#include "template/main/pagination.ftl">
<@pagination method="archives" datas=posts display="${settings.page_number!5}" />
<#else>
<div class="card card-empty">
<i class="ri-inbox-2-fill"></i>
还没有发表过文章,回<a href="${context!}">主页</a>看看吧
</div>
</#if>
</@layout>