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>
|
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">
|
|
|
|
<a class="author" href="{{ $authorLink }}" rel="author" target="_blank">
|
|
|
|
<i class="fas fa-user-circle fa-fw"></i>{{ $author }}
|
|
|
|
</a>
|
|
|
|
</span>
|
|
|
|
|
2020-01-31 15:53:04 +01:00
|
|
|
{{- with .Params.categories -}}
|
2020-02-21 05:49:55 +01:00
|
|
|
<span class="post-category">
|
|
|
|
{{- T "included" -}}
|
2020-01-31 15:53:04 +01:00
|
|
|
{{- range . -}}
|
2020-02-21 05:49:55 +01:00
|
|
|
|
|
|
|
<span>
|
|
|
|
<a href="{{ `/categories/` | relLangURL }}{{ urlize .}}">
|
|
|
|
<i class="far fa-folder fa-fw"></i>{{ . | humanize }}
|
|
|
|
</a>
|
|
|
|
</span>
|
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-02-24 10:00:39 +01:00
|
|
|
{{- if $scratch.Get "production" | and .Site.Params.valine.enable | and .Site.Params.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-02-13 18:30:33 +01:00
|
|
|
<div class="comment">
|
2020-01-31 15:53:04 +01:00
|
|
|
{{- if ( .Params.comment | default true ) -}}
|
2020-02-13 18:30:33 +01:00
|
|
|
{{- partial "comment.html" . -}}
|
2020-01-31 15:53:04 +01:00
|
|
|
{{- end -}}
|
2019-08-04 15:53:35 +02:00
|
|
|
</div>
|
|
|
|
</article>
|
2020-02-06 17:10:00 +01:00
|
|
|
{{- end -}}
|