2021-12-07 02:57:34 +00:00
|
|
|
{{- define "main" }}
|
|
|
|
{{- $s := .Site.Params }}
|
|
|
|
{{- $p := .Params }}
|
2022-03-06 21:59:30 +00:00
|
|
|
{{- $ageDays := div (sub now.Unix .Date.Unix) 86400 -}}
|
2021-12-07 02:57:34 +00:00
|
|
|
{{- $scratch := newScratch }}
|
|
|
|
{{- if isset $p "image" }}
|
|
|
|
{{- $scratch.Set "image" $p.image }}
|
|
|
|
{{- else }}
|
|
|
|
{{ $scratch.Set "image" $s.fallBackOgImage }}
|
|
|
|
{{- end }}
|
|
|
|
{{- $image := $scratch.Get "image" }}
|
|
|
|
{{- $bg := absLangURL (path.Join "images" $image) }}
|
|
|
|
<div class="{{ if ne $p.singleColumn true }}grid-inverse {{ end }}wrap content">
|
|
|
|
<article class="post_content">
|
|
|
|
{{- $t := .Title }}
|
|
|
|
<h1 class="post_title">{{ $t }}</h1>
|
|
|
|
{{- partial "post-meta" . }}
|
2022-03-06 21:59:30 +00:00
|
|
|
{{- with .Param "lastmod" -}}
|
|
|
|
{{- $ageDays = div (sub now.Unix .Unix) 86400 -}}
|
|
|
|
{{- end -}}
|
2022-03-17 20:40:33 +00:00
|
|
|
{{- if and (gt $ageDays 365) (not $p.timeless) -}}
|
2022-03-06 21:59:30 +00:00
|
|
|
<div class="notices info"><div class="label">{{- T "old_content_label" -}}</div>
|
|
|
|
<i>{{- T "old_content_note" -}}</i>
|
2022-03-06 21:24:00 +00:00
|
|
|
</div>
|
2022-03-06 21:59:30 +00:00
|
|
|
{{- end -}}
|
2021-12-07 02:57:34 +00:00
|
|
|
{{- partial "image-feature" . }}
|
2021-12-17 21:49:08 +00:00
|
|
|
{{ if and (gt .WordCount 400 ) (gt (len .TableOfContents) 180) ($s.toc) }}
|
|
|
|
<div class="post_toc">
|
|
|
|
<div class="wrap-collapsible">
|
|
|
|
<input id="collapsible" class="toggle" type="checkbox">
|
|
|
|
<label for="collapsible" class="lbl-toggle" tabindex="0">{{ T "overview" }}...</label>
|
|
|
|
<div class="collapsible-content">
|
|
|
|
<div class="content-inner">
|
|
|
|
{{ .TableOfContents }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{ end }}
|
2021-12-07 02:57:34 +00:00
|
|
|
<div class="post_body">
|
|
|
|
{{- .Content }}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{{- $showRelatedInArticle := true }}
|
|
|
|
{{- if eq $s.showRelatedInArticle false }}
|
|
|
|
{{- $showRelatedInArticle = false }}
|
|
|
|
{{- else if eq $p.showRelatedInArticle false }}
|
|
|
|
{{- $showRelatedInArticle = false }}
|
|
|
|
{{- end }}
|
|
|
|
{{- if ne $showRelatedInArticle false }}
|
|
|
|
{{- partial "related" . }}
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{- $showComments := true }}
|
|
|
|
{{- if eq $s.comments false }}
|
|
|
|
{{- $showComments = false }}
|
|
|
|
{{- else if eq $p.comments false }}
|
|
|
|
{{- $showComments = false }}
|
|
|
|
{{- end }}
|
|
|
|
{{- if ne $showComments false }}
|
|
|
|
{{- partial "comments" . }}
|
|
|
|
{{- end }}
|
|
|
|
{{- partial "i18nlist" . }}
|
|
|
|
|
|
|
|
</article>
|
|
|
|
{{- if ( ne $p.sidebar false ) }}
|
|
|
|
{{- partial "sidebar" . }}
|
|
|
|
{{ end }}
|
|
|
|
</div>
|
|
|
|
{{- end }}
|