-
Notifications
You must be signed in to change notification settings - Fork 0
/
archives.tmpl
67 lines (57 loc) · 1.6 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
66
67
{{- define "sonic_theme_paper_mod/archives" -}}
<!DOCTYPE html>
<html lang="zh" dir="auto">
<head>
<title>Archives - {{ .blog_title }}</title>
{{ template "sonic_theme_paper_mod/module/head" .}}
</head>
<body class="list" id="top">
{{template "sonic_theme_paper_mod/module/header" .}}
<main class="main">
<header class="page-header">
<h1>
Archive
</h1>
</header>
<div class="archive-posts">
{{range $archive:=.archives}}
<div class="archive-year">
<h2 class="archive-year-header">
{{$archive.Year}}
<sup class="archive-count">{{len $archive.Posts}}</sup>
</h2>
{{range $post:=$archive.Posts}}
<div class="archive-entry">
<h3 class="archive-entry-title">{{$post.Title}}
</h3>
<div class="archive-meta"><span>{{unix_milli_time_format "2006-01-02 15:04:05" $post.CreateTime}}</span> · {{ $post.WordCount }} words </div>
<a class="entry-link" href="{{$post.FullPath}}"></a>
</div>
{{end}}
</div>
{{end}}
</div>
<footer class="page-footer">
{{if (gt .posts.Pages 1)}}
{{$pagination:=(archivesPagination .posts.PageNum .posts.Pages 3)}}
{{if $pagination.HasPrev}}
<nav class="pagination">
<a class="prev" href="{{$pagination.PrevPageFullPath}}">
« Prev
</a>
</nav>
{{end}}
{{if $pagination.HasNext}}
<nav class="pagination">
<a class="next" href="{{$pagination.NextPageFullPath}}">
Next »
</a>
</nav>
{{end}}
{{end}}
</footer>
</main>
{{template "sonic_theme_paper_mod/module/footer" .}}
</body>
</html>
{{end}}