-
Notifications
You must be signed in to change notification settings - Fork 356
/
Copy pathsingle.html
117 lines (109 loc) · 3.77 KB
/
single.html
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
105
106
107
108
109
110
111
112
113
114
115
116
117
<!DOCTYPE html>
<html lang="{{ .Site.LanguageCode }}">
{{ partial "head.html" . }}
<body class="max-width mx-auto px3 ltr">
<div class="content index py4">
{{ partial "page_nav.html" . }}
<article class="post" itemscope itemtype="http://schema.org/BlogPosting">
<header>
<h1 class="posttitle" itemprop="name headline">
{{ .Title }}
</h1>
<div class="meta">
{{ if (or (isset .Site "author") (isset .Site "title"))}}
<span class="author" itemprop="author" itemscope itemtype="http://schema.org/Person">
<span itemprop="name">
{{ if isset .Site "author" }}
{{ .Site.Author }}
{{ else if isset .Site "title" }}
{{ .Site.Title }}
{{ end }}
</span>
</span>
{{ end }}
<div class="postdate">
{{ $dataFormat := .Site.Params.dateFormat | default "2006-01-02" }}
<time datetime="{{ .Date }}" itemprop="datePublished">{{ .Date.Format $dataFormat }}</time>
{{ if (and .Site.Params.show_updated (ne .Lastmod .Date)) }}
(Updated: <time datetime="{{ .Lastmod }}" itemprop="dateModified">{{ .Lastmod.Format $dataFormat }}</time>)
{{ end }}
</div>
{{ $showReadTime := .Site.Params.showReadTime | default false }}
{{if $showReadTime}}
<div class="article-read-time">
<i class="far fa-clock"></i>
{{ $readTime := math.Round (div (countwords .Content) 220.0) }}
{{ $readTime }} minute read
</div>
{{ end }}
{{ if gt .Params.categories 0 }}
<div class="article-category">
<i class="fas fa-archive"></i>
{{ range $index, $value := .Params.categories }}
{{ if gt $index 0 }} {{ print ", " }} {{ end }}
<a class="category-link" href="{{ "/categories/" | relLangURL }}{{ $value | urlize }}">{{ $value }}</a>
{{ end }}
</div>
{{ end }}
{{ if gt .Params.tags 0 }}
<div class="article-tag">
<i class="fas fa-tag"></i>
{{ range $index, $value := .Params.tags }}
{{ if gt $index 0 }} {{ print ", " }} {{ end }}
<a class="tag-link" href="{{ "/tags/" | relLangURL }}{{ $value | urlize }}" rel="tag">{{ $value }}</a>
{{ end }}
</div>
{{ end }}
</div>
</header>
{{ with .Resources.ByType "image" }}
<div class="article-gallery">
{{ range $index, $value := . }}
<a class="gallery-item" href="{{ .RelPermalink }}" rel="gallery_{{ $index }}">
<img src="{{ .RelPermalink }}" itemprop="image" />
</a>
{{ end }}
</div>
{{ end }}
{{ if .Site.Params.tocInline }}
<div id="toc">
{{ .TableOfContents }}
</div>
{{ end }}
<div class="content" itemprop="articleBody">
{{ .Content}}
</div>
</article>
{{ partial "comments.html" . }}
{{ partial "page_nav_mobile.html" . }}
{{ partial "footer.html" . }}
</div>
</body>
<link rel="stylesheet" href={{ "lib/font-awesome/css/all.min.css" | relURL }}>
<script src={{ "lib/jquery/jquery.min.js" | relURL }}></script>
<script src={{ "js/main.js" | relURL }}></script>
{{ if not (isset site.Params "disablecopy") }}
<script src={{ "js/code-copy.js" | relURL }}></script>
{{ end }}
{{ $mathjax := false }}
{{ if isset .Params "mathjax" }}
{{ $mathjax = .Params.mathjax }}
{{ else if isset .Site.Params "mathjax" }}
{{ $mathjax = .Site.Params.mathjax }}
{{ end }}
{{ if $mathjax }}
<script>
MathJax = {
tex: {
inlineMath: [['$', '$'], ['\\(', '\\)']]
},
svg: {
fontCache: 'global'
}
};
</script>
<script type="text/javascript" id="MathJax-script" async
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js">
</script>
{{ end }}
</html>