2020-01-31 15:53:04 +01: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-02-24 10:00:39 +01:00
|
|
|
{{- $scratch := .Scratch.Get "scratch" -}}
|
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-03-16 09:14:37 +01:00
|
|
|
{{- with .Params.subtitle -}}
|
|
|
|
<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-03-08 14:02:21 +01:00
|
|
|
{{- $author := .Params.author | default .Site.Author.name | default (T "author") -}}
|
2020-02-19 11:48:37 +01:00
|
|
|
{{- $authorLink := .Params.authorLink | default .Site.Author.link | default (relLangURL "/") -}}
|
2020-02-21 05:49:55 +01:00
|
|
|
<span class="post-author">
|
2020-03-09 20:33:28 +01:00
|
|
|
{{- $link := dict "class" "author" "href" $authorLink "title" "Author" "rel" "author" "icon" (dict "class" "fas fa-user-circle fa-fw") "content" $author -}}
|
|
|
|
{{- partial "plugin/link.html" $link -}}
|
2020-02-21 05:49:55 +01:00
|
|
|
</span>
|
|
|
|
|
2020-01-31 15:53:04 +01: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 -}}
|
|
|
|
<a href="{{ `/categories/` | relLangURL }}{{ urlize $value }}">
|
|
|
|
<i class="far fa-folder fa-fw"></i>{{ $value | humanize }}
|
|
|
|
</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-02-03 11:38:10 +01:00
|
|
|
{{- $publish_date := .PublishDate.Format (.Site.Params.dateFormatToUse | default "2006-01-02") -}}
|
2019-08-26 19:15:00 +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-03-16 14:35:16 +01:00
|
|
|
{{- if eq hugo.Environment "production" | and .Site.Params.comment.valine.enable | and .Site.Params.comment.valine.visitor -}}
|
2019-08-17 17:16:09 +02:00
|
|
|
<span id="{{ .RelPermalink | relURL }}" class="leancloud_visitors" data-flag-title="{{ .Title }}">
|
2020-03-03 15:25:48 +01: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-02-17 05:44:04 +01:00
|
|
|
{{- with .Params.featuredImage -}}
|
2020-02-13 18:30:33 +01:00
|
|
|
<div class="featured-image">
|
2020-02-27 13:14:40 +01:00
|
|
|
{{- partial "plugin/image.html" (dict "src" . "description" $.Description "scratch" $scratch) -}}
|
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-02-03 11:38:10 +01:00
|
|
|
{{- /* TOC */ -}}
|
2020-01-31 15:53:04 +01:00
|
|
|
{{- if or .Params.toc (and .Site.Params.toc (ne .Params.toc false)) -}}
|
2020-02-21 17:34:44 +01:00
|
|
|
<div class="toc" id="toc-auto">
|
2020-03-08 14:02:21 +01:00
|
|
|
<h2 class="toc-title">{{ T "contents" }}</h2>
|
2020-02-17 05:44:04 +01:00
|
|
|
{{- $globalAutoCollapseToc := .Site.Params.autoCollapseToc | default true }}
|
2020-02-21 04:11:56 +01:00
|
|
|
<div class="toc-content{{ if not (and $globalAutoCollapseToc (ne .Params.autoCollapseToc false)) }} always-active{{ end }}" id="toc-content-auto"></div>
|
|
|
|
</div>
|
2020-02-21 17:34:44 +01:00
|
|
|
<div class="toc" id="toc-static">
|
2019-08-19 21:01:15 +02:00
|
|
|
<details>
|
2020-01-31 15:53:04 +01:00
|
|
|
<summary>
|
2020-02-21 04:11:56 +01:00
|
|
|
<div class="toc-title">
|
2020-03-08 14:02:21 +01:00
|
|
|
<span>{{ T "contents" }}</span>
|
2020-01-31 15:53:04 +01:00
|
|
|
<span><i class="details icon fas fa-angle-down"></i></span>
|
|
|
|
</div>
|
|
|
|
</summary>
|
2020-02-21 04:11:56 +01:00
|
|
|
<div class="toc-content" id="toc-content-static">
|
2020-02-21 17:34:44 +01:00
|
|
|
{{- $toc := .TableOfContents -}}
|
|
|
|
{{- $toc = partial "function/fontawesome.html" $toc -}}
|
|
|
|
{{- $toc = partial "function/ruby.html" $toc -}}
|
|
|
|
{{- $toc | safeHTML -}}
|
2019-08-19 21:01:15 +02:00
|
|
|
</div>
|
|
|
|
</details>
|
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-02-21 16:42:35 +01:00
|
|
|
{{- partial "single/content.html" .Content -}}
|
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-03-16 08:01:51 +01:00
|
|
|
{{- if ( .Params.comment | default true ) -}}
|
|
|
|
{{- partial "comment.html" . -}}
|
|
|
|
{{- end -}}
|
2019-08-04 15:53:35 +02:00
|
|
|
</article>
|
2020-02-06 17:10:00 +01:00
|
|
|
{{- end -}}
|