blob: ad3057f40a24cc8da219cb78c81cfb20c174385b (
plain)
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
|
{{ define "head" }}
<link rel="stylesheet" href='{{ "css/single.css" | absURL }}'>
{{ end }}
{{ define "main" }}
<main id="main" class="post">
{{ if ne .Section "post"}}
<article class="content">
{{ .Content }}
</article>
{{ else }}
{{ if .Site.Params.outdated.enable }}
{{ $days := div (sub now.Unix .Lastmod.Unix) 86400 }}
{{ if gt $days .Site.Params.outdated.limit }}
<div class="warning">{{ printf .Site.Params.outdated.warning $days | safeHTML }}</div>
{{ end }}
{{ end }}
<h1>{{ .Title }}</h1>
{{ if ne .Params.tags nil }}
<div>
<b>Keywords: </b>
{{ range .Params.tags }}
<a class="link" href='{{ "tags" | absURL }}/{{ . | urlize }}'>#{{ . }}</a>
{{ end }}
</div>
{{ end }}
{{ if cond (ne .Params.toc nil) .Params.toc .Site.Params.toc }}
<details>
<summary>
<b>Table of Contents</b>
</summary>
<div class="toc">{{ .TableOfContents }}</div>
</details>
{{ end }}
<article class="content">
{{ if .Site.Params.emphasisWithDots }}
{{ .Content | replaceRE "<strong>(\\p{Han}+?)</strong>" "<strong class=chinese>$1</strong>" | safeHTML }}
{{ else }}
{{ .Content }}
{{ end }}
</article>
<div class="paginator">
{{ if .PrevInSection }}
<a class="link" href="{{ .PrevInSection.Permalink }}">← prev</a>
{{ else }}
<a></a>
{{ end }}
{{ if .NextInSection }}
<a class="link" href="{{ .NextInSection.Permalink }}">next →</a>
{{ else }}
<a></a>
{{ end }}
</div>
<div class="comment">
<!-- disqus -->
{{ template "_internal/disqus.html" . }}
<!-- giscus -->
{{ if .Site.Params.giscus.enable }}
{{ .Site.Params.giscus.script | safeHTML }}
{{ end }}
<!-- utterances -->
{{ if .Site.Params.utterances.enable }}
{{ .Site.Params.utterances.script | safeHTML }}
{{ end }}
</div>
{{ end }}
</main>
{{ end }}
|