2020-05-01 10:23:17 +02:00
|
|
|
{{- define "title" }}{{ .Title }} - {{ .Site.Title }}{{ end -}}
|
2019-08-04 15:53:35 +02:00
|
|
|
|
2020-01-31 15:53:04 +01:00
|
|
|
{{- define "content" -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- $params := .Scratch.Get "params" -}}
|
2020-04-15 09:46:50 +02:00
|
|
|
|
2020-05-12 16:40:49 +02:00
|
|
|
{{- $toc := $params.toc -}}
|
|
|
|
{{- if eq $toc true -}}
|
|
|
|
{{- $toc = .Site.Params.page.toc | default dict -}}
|
|
|
|
{{- else if eq $toc false -}}
|
|
|
|
{{- $toc = dict "enable" false -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
2020-04-15 09:46:50 +02:00
|
|
|
{{- /* Auto TOC */ -}}
|
2020-05-12 16:40:49 +02:00
|
|
|
{{- if ne $toc.enable false -}}
|
2020-04-15 09:46:50 +02:00
|
|
|
<div class="toc" id="toc-auto">
|
|
|
|
<h2 class="toc-title">{{ T "contents" }}</h2>
|
2020-05-12 16:40:49 +02:00
|
|
|
<div class="toc-content{{ if eq $toc.auto false }} always-active{{ end }}" id="toc-content-auto"></div>
|
2020-04-15 09:46:50 +02:00
|
|
|
</div>
|
|
|
|
{{- end -}}
|
|
|
|
|
2020-02-13 18:30:33 +01:00
|
|
|
<article class="page single">
|
2020-02-03 11:38:10 +01:00
|
|
|
{{- /* Title */ -}}
|
2020-02-13 18:30:33 +01:00
|
|
|
<h1 class="single-title animated flipInX">{{ .Title }}</h1>
|
2020-04-21 16:55:06 +02:00
|
|
|
|
|
|
|
{{- /* Subtitle */ -}}
|
|
|
|
{{- with $params.subtitle -}}
|
2020-03-16 09:14:37 +01:00
|
|
|
<h2 class="single-subtitle">{{ . }}</h2>
|
|
|
|
{{- end -}}
|
2019-08-16 21:40:34 +02:00
|
|
|
|
2020-02-03 11:38:10 +01:00
|
|
|
{{- /* Meta */ -}}
|
2020-02-21 05:49:55 +01:00
|
|
|
<div class="post-meta">
|
|
|
|
<div class="post-meta-line">
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- $author := $params.author | default .Site.Author.name | default (T "author") -}}
|
2020-04-22 15:34:38 +02:00
|
|
|
{{- $authorLink := $params.authorlink | default .Site.Author.link | default .Site.Home.RelPermalink -}}
|
2020-02-21 05:49:55 +01:00
|
|
|
<span class="post-author">
|
2020-03-17 14:16:04 +01:00
|
|
|
{{- $options := dict "class" "author" "href" $authorLink "title" "Author" "rel" "author" "icon" (dict "class" "fas fa-user-circle fa-fw") "content" $author -}}
|
|
|
|
{{- partial "plugin/link.html" $options -}}
|
2020-02-21 05:49:55 +01:00
|
|
|
</span>
|
|
|
|
|
2020-04-28 06:53:06 +02:00
|
|
|
{{- with .Params.categories -}}
|
2020-03-14 07:42:12 +01:00
|
|
|
|
|
|
|
<span class="post-category">
|
2020-02-21 05:49:55 +01:00
|
|
|
{{- T "included" -}}
|
2020-03-14 07:42:12 +01:00
|
|
|
{{- range $index, $value := . -}}
|
|
|
|
{{- if gt $index 0 }} {{ end -}}
|
2020-04-24 13:04:37 +02:00
|
|
|
{{- $category := $value | anchorize | printf "/categories/%s" | $.Site.GetPage -}}
|
2020-04-22 19:22:29 +02:00
|
|
|
<a href="{{ $category.RelPermalink }}">
|
|
|
|
<i class="far fa-folder fa-fw"></i>{{ $category.Title }}
|
2020-03-14 07:42:12 +01:00
|
|
|
</a>
|
2020-01-31 15:53:04 +01:00
|
|
|
{{- end -}}
|
2019-08-04 15:53:35 +02:00
|
|
|
</span>
|
2020-01-31 15:53:04 +01:00
|
|
|
{{- end -}}
|
2019-08-04 15:53:35 +02:00
|
|
|
</div>
|
2020-02-21 05:49:55 +01:00
|
|
|
<div class="post-meta-line">
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- $publish_date := .PublishDate.Format (.Site.Params.dateformat | default "2006-01-02") -}}
|
2020-05-14 10:14:14 +02:00
|
|
|
<i class="far fa-calendar-alt fa-fw"></i> <time datetime={{ $publish_date }}>{{ $publish_date }}</time>
|
|
|
|
<i class="fas fa-pencil-alt fa-fw"></i> {{ T "wordCount" .WordCount }}
|
|
|
|
<i class="far fa-clock fa-fw"></i> {{ T "readingTime" .ReadingTime }}
|
2020-04-22 11:50:30 +02:00
|
|
|
{{- $comment := .Scratch.Get "comment" | default dict -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- if $comment.enable | and $comment.valine.enable | and $comment.valine.visitor -}}
|
2020-04-22 15:34:38 +02:00
|
|
|
<span id="{{ .RelPermalink }}" class="leancloud_visitors" data-flag-title="{{ .Title }}">
|
2020-05-14 10:14:14 +02:00
|
|
|
<i class="far fa-eye fa-fw"></i> <span class=leancloud-visitors-count></span> {{ T "views" }}
|
2019-08-26 19:15:00 +02:00
|
|
|
</span>
|
2019-08-17 17:16:09 +02:00
|
|
|
{{- end -}}
|
2019-08-16 21:40:34 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2020-02-03 11:38:10 +01:00
|
|
|
{{- /* Featured image */ -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- with $params.featuredimage -}}
|
2020-02-13 18:30:33 +01:00
|
|
|
<div class="featured-image">
|
2020-05-01 17:29:24 +02:00
|
|
|
{{- dict "src" . "alt" $.Description "large" true | partial "plugin/image.html" -}}
|
2019-08-22 20:01:22 +02:00
|
|
|
</div>
|
2020-01-31 15:53:04 +01:00
|
|
|
{{- end -}}
|
2019-08-19 21:01:15 +02:00
|
|
|
|
2020-04-15 09:46:50 +02:00
|
|
|
{{- /* Static TOC */ -}}
|
2020-05-12 16:40:49 +02:00
|
|
|
{{- if ne $toc.enable false -}}
|
2020-04-25 21:25:10 +02:00
|
|
|
<div class="details toc" id="toc-static">
|
|
|
|
<div class="details-summary toc-title">
|
|
|
|
<span>{{ T "contents" }}</span>
|
2020-04-27 19:38:22 +02:00
|
|
|
<span><i class="details-icon fas fa-angle-right"></i></span>
|
2020-04-25 21:25:10 +02:00
|
|
|
</div>
|
|
|
|
<div class="details-content toc-content" id="toc-content-static">
|
2020-04-26 17:00:29 +02:00
|
|
|
{{- dict "content" .TableOfContents "ruby" $params.ruby "fraction" $params.fraction "fontawesome" $params.fontawesome | partial "function/content.html" | safeHTML -}}
|
2020-04-25 21:25:10 +02:00
|
|
|
</div>
|
2020-02-21 04:11:56 +01:00
|
|
|
</div>
|
2020-01-31 15:53:04 +01:00
|
|
|
{{- end -}}
|
2019-08-17 17:16:09 +02:00
|
|
|
|
2020-02-03 11:38:10 +01:00
|
|
|
{{- /* Content */ -}}
|
2020-02-24 10:00:39 +01:00
|
|
|
<div class="content" id="content">
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- dict "content" .Content "ruby" $params.ruby "fraction" $params.fraction "fontawesome" $params.fontawesome | partial "function/content.html" | safeHTML -}}
|
2019-08-04 15:53:35 +02:00
|
|
|
</div>
|
|
|
|
|
2020-02-03 11:38:10 +01:00
|
|
|
{{- /* Footer */ -}}
|
2020-02-21 16:42:35 +01:00
|
|
|
{{- partial "single/footer.html" . -}}
|
2019-08-04 15:53:35 +02:00
|
|
|
|
2020-02-03 11:38:10 +01:00
|
|
|
{{- /* Comment */ -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- partial "comment.html" . -}}
|
2019-08-04 15:53:35 +02:00
|
|
|
</article>
|
2020-02-06 17:10:00 +01:00
|
|
|
{{- end -}}
|