forked from go-sonic/default-theme-anatole
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpost.tmpl
104 lines (100 loc) · 5.55 KB
/
post.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
{{- define "caicai_anatole/post" -}}
<!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}} - {{.post.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" .}}
{{template "caicai_anatole/module/highlightjs/libs-import" . }}
{{template "caicai_anatole/module/lightgallery/libs-import" .}}
{{template "caicai_anatole/module/katex/libs-import" .}}
<script src="https://cdn.jsdelivr.net/npm/vue@2"></script>
</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="m-[30px] mt-[20px] border-b border-gray-200 animated fadeInDown">
<div class="flex flex-col pb-3">
<div class="flex flex-wrap items-end">
<h3 class="text-xl leading-6 font-medium text-gray-900">{{ .post.Title}}</h3>
</div>
<div>
<div class="post-info mt-2" x-data="posts">
<div class="meta">
<div class="info">
<i class="iconify w-3 h-3" data-icon="mdi:calendar-month-outline"></i>
<span>{{unix_milli_time_format "2006-01-02" .post.CreateTime}}</span>
<i class="iconify w-3 h-3" data-icon="mdi:eye"></i>
<span>{{.post.Visits}}</span>
<i class="iconify w-3 h-3" data-icon="mdi:comment-outline"></i>
<a href="{{.post.FullPath}}#comment_widget">{{.post.CommentCount}}</a>
<div class="inline-block hover:text-red-700 cursor-pointer"
x-bind:class="{'text-red-700': liked({{.post.ID}})}"
x-on:click="handleLike({{.post.ID}})">
<i x-show="liked({{.post.ID}})" class="iconify w-3 h-3"
data-icon="mdi:heart"></i>
<i x-show="!liked({{.post.ID}})" class="iconify w-3 h-3"
data-icon="mdi:heart-outline"></i>
<span data-post-id-likes="{{.post.ID}}">{{.post.Likes}}</span>
</div>
{{if .post.Categories}}
<i class="iconify w-3 h-3" data-icon="mdi:folder-outline"></i>
{{range $category:=.post.Categories}}
<a href="{{$category.FullPath}}"
title="{{$category.Name}}">{{$category.Name}}</a>
{{end}}
{{end}}
{{if .tags}}
<i class="iconify w-3 h-3" data-icon="mdi:tag"></i>
{{range $tag:=.tags}}
<a href="{{$tag.FullPath}}" title="{{$tag.Name}}">{{$tag.Name}}</a>
{{end}}
{{end}}
</div>
</div>
</div>
</div>
</div>
</div>
<div class="post-page">
<div class="post animated fadeInDown">
<div id="post-content" class="post-content markdown-body">
{{noescape .post.Content}}
</div>
</div>
<div class="pagination flex justify-between items-center">
{{if .prevPost}}
<a class="btn" role="navigation" href="{{.prevPost.FullPath}}"
title="{{.prevPost.Title}}">上一篇</a>
{{end}}
{{if .nextPost}}
<a class="btn" role="navigation" href="{{.nextPost.FullPath}}" title="{{.nextPost.Title}}">
下一篇
</a>
{{end}}
</div>
<div id="comment_widget" style="margin: 30px;">
{{template "global.comment" .}}
</div>
</div>
</div>
</div>
{{template "caicai_anatole/module/highlightjs/scripts" .}}
{{template "caicai_anatole/module/lightgallery/scripts" .}}
{{template "caicai_anatole/module/post-likes/scripts" .}}
{{template "caicai_anatole/module/post-search-modal" .}}
</body>
</html>
{{end}}