-
Notifications
You must be signed in to change notification settings - Fork 1
/
tag.tmpl
48 lines (48 loc) · 1.94 KB
/
tag.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
{{- define "meepo_earth/tag" -}}
<!DOCTYPE html>
<html lang="zh">
<head>
{{ template "meepo_earth/module/libs/import" . }}
<script>
main.initColorScheme({{ .settings.color_scheme}}, {{ .settings.enable_change_color_scheme }})
</script>
</head>
<body class="bg-slate-50 dark:bg-slate-900">
{{ template "meepo_earth/module/header" . }}
{{ template "meepo_earth/module/hero" . }}
<section class="container mx-auto mt-6 grid grid-cols-4 gap-6">
<div class="z-0 col-span-4 sm:col-span-3">
<div class="rounded-xl bg-white p-4 shadow transition-all duration-500 hover:shadow-md dark:bg-slate-800">
{{ template "meepo_earth/module/tag-filter" . }}
</div>
{{ if .tag }}
{{ $posts := (slice (listPostByTagID .tag.ID) 0) }}
{{ if $posts }}
{{ template "meepo_earth/module/post-list" . }}
{{ if (gt (len $posts) 10) }}
<div class="mt-10 flex justify-end">
<a
class="group inline-flex items-center gap-2 truncate text-sm text-gray-600 hover:text-gray-900 dark:text-slate-100 dark:hover:text-slate-200"
href="{{ .tag.FullPath }}"
>
<span>更多文章</span>
<span class="i-tabler-chevron-right -translate-x-1 text-lg transition-all group-hover:translate-x-0"></span>
</a>
</div>
{{ end }}
{{ else }}
<div class="mt-6 flex items-center justify-center">
<span class="text-sm font-light text-gray-600 dark:text-slate-200">此标签下没有文章</span>
</div>
{{ end }}
{{ end }}
</div>
<aside class="z-0 col-span-1 hidden h-full flex-col gap-6 sm:flex">
{{ template "meepo_earth/module/_include/sidebar-post" .}}
</aside>
{{/* 博文清单 */}}
</section>
{{ template "meepo_earth/module/footer" . }}
</body>
</html>
{{- end -}}