forked from go-sonic/default-theme-anatole
-
Notifications
You must be signed in to change notification settings - Fork 0
/
archives.tmpl
65 lines (60 loc) · 2.94 KB
/
archives.tmpl
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
61
62
63
64
65
{{- define "caicai_anatole/archives" -}}
<!DOCTYPE html>
<html lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>归档 - {{.blog_title}}</title>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<meta name="format-detection" content="telephone=no"/>
<meta name="renderer" content="webkit"/>
<meta name="author" content="{{ .user.Nickname}}"/>
<meta name="keywords" content="{{ .meta_keywords}}"/>
<meta name="description" content="{{ .meta_description}}"/>
<link rel="alternate" type="application/rss+xml" title="atom 1.0" href="{{ .atom_url}}"/>
{{template "global.head" .}}
{{template "caicai_anatole/module/styles" .}}
</head>
<body x-data="{ postSearchVisible: false }">
{{template "caicai_anatole/module/sidebar" .}}
<div class="main">
{{template "caicai_anatole/module/page-top" .}}
<div class="content">
<div class="archive animated fadeInDown">
<ul class="list-with-title">
{{range $archive:=.archives}}
<div class="listing-title">{{$archive.Year}}</div>
<ul class="listing">
{{range $post:=$archive.Posts}}
<div class="listing-item">
<div class="listing-post">
<a href="{{$post.FullPath}}" title="{{$post.Title}}">{{$post.Title}}</a>
<div class="post-time">
<span class="date">{{unix_milli_time_format "2006-01-02" $post.CreateTime}}</span>
</div>
</div>
</div>
{{end}}
</ul>
{{end}}
</ul>
</div>
{{if (gt .posts.Pages 1)}}
{{$pagination:=(archivesPagination .posts.PageNum .posts.Pages 3)}}
<div class="pagination flex justify-between items-center">
{{if $pagination.HasPrev}}
<a class="btn" role="navigation" href="{{$pagination.PrevPageFullPath}}">上一页</a>
{{end }}
<span class="text-sm">{{add .posts.PageNum 1}}/{{ .posts.Pages}}</span>
{{if $pagination.HasNext}}
<a class="btn" role="navigation" href="{{$pagination.NextPageFullPath}}">下一页</a>
{{end}}
</div>
{{end}}
</div>
</div>
{{template "caicai_anatole/module/post-search-modal" .}}
</body>
</html>
{{end}}