2019-01-28 03:11:02 +03:00
|
|
|
{{ define "main" }}
|
2019-03-31 20:28:38 +03:00
|
|
|
<div class="post">
|
|
|
|
<h1 class="post-title">
|
|
|
|
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1>
|
|
|
|
<div class="post-meta">
|
2020-03-10 17:29:33 +03:00
|
|
|
{{ if .Params.Date }}
|
2019-03-21 02:40:07 +03:00
|
|
|
<span class="post-date">
|
2021-10-24 11:43:59 +03:00
|
|
|
{{ .Date.Format "2006-01-02" }}
|
|
|
|
{{ if $.Site.Params.showLastUpdated }}
|
|
|
|
[{{or $.Site.Params.updatedDatePrefix "Updated"}}: {{ .Lastmod.Format "2006-01-02" }}]
|
|
|
|
{{ end }}
|
2019-03-21 02:40:07 +03:00
|
|
|
</span>
|
2019-06-09 12:59:20 +03:00
|
|
|
{{ end }}
|
2019-03-31 20:28:38 +03:00
|
|
|
{{ with .Params.Author }}
|
2021-10-24 11:43:59 +03:00
|
|
|
<span class="post-author">:: {{ . }}</span>
|
|
|
|
{{ end }}
|
|
|
|
{{ if and (.Param "readingTime") (eq (.Param "readingTime") true) }}
|
|
|
|
<span class="post-reading-time">:: {{ .ReadingTime }} min read ({{ .WordCount }} words)</span>
|
2019-01-28 03:11:02 +03:00
|
|
|
{{ end }}
|
2019-03-31 20:28:38 +03:00
|
|
|
</div>
|
2019-01-28 03:11:02 +03:00
|
|
|
|
2019-03-31 20:28:38 +03:00
|
|
|
{{ if .Params.tags }}
|
|
|
|
<span class="post-tags">
|
|
|
|
{{ range .Params.tags }}
|
2019-04-05 09:18:21 +03:00
|
|
|
#<a href="{{ (urlize (printf "tags/%s/" .)) | absLangURL }}">{{ . }}</a>
|
2019-01-28 03:11:02 +03:00
|
|
|
{{ end }}
|
2019-03-31 20:28:38 +03:00
|
|
|
</span>
|
|
|
|
{{ end }}
|
2019-01-28 03:11:02 +03:00
|
|
|
|
2020-06-18 01:40:31 +03:00
|
|
|
{{ if .Params.Cover }}
|
|
|
|
<img src="{{ .Params.Cover | absURL }}" class="post-cover" alt="{{ .Title | plainify | default " " }}" />
|
2019-03-21 02:40:07 +03:00
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ if .Params.Toc }}
|
|
|
|
<div class="table-of-contents">
|
2019-03-25 06:00:41 +03:00
|
|
|
<h2>
|
|
|
|
{{ if .Params.TocTitle }}
|
|
|
|
{{ .Params.TocTitle }}
|
|
|
|
{{ else if $.Site.Params.TocTitle }}
|
|
|
|
{{ $.Site.Params.TocTitle }}
|
|
|
|
{{ else }}
|
|
|
|
Table of Contents
|
|
|
|
{{ end }}
|
|
|
|
</h2>
|
2019-03-21 02:40:07 +03:00
|
|
|
{{ .TableOfContents }}
|
|
|
|
</div>
|
2019-03-31 20:28:38 +03:00
|
|
|
{{ end }}
|
2019-03-31 20:18:08 +03:00
|
|
|
|
2019-03-31 20:28:38 +03:00
|
|
|
<div class="post-content">
|
2020-01-23 23:04:09 +03:00
|
|
|
{{- with .Content -}}
|
2020-01-17 15:11:41 +03:00
|
|
|
<div>
|
2020-01-24 10:21:30 +03:00
|
|
|
{{ . | replaceRE "(<h[1-9] id=\"([^\"]+)\".+)(</h[1-9]+>)" `${1}<a href="#${2}" class="hanchor" ariaLabel="Anchor">⌗</a> ${3}` | safeHTML }}
|
2020-01-17 15:11:41 +03:00
|
|
|
</div>
|
2020-01-24 10:21:30 +03:00
|
|
|
{{- end -}}
|
2019-01-28 03:11:02 +03:00
|
|
|
</div>
|
2019-03-21 02:40:07 +03:00
|
|
|
|
|
|
|
{{ if eq .Type $.Site.Params.contentTypeName }}
|
|
|
|
{{ partial "posts_pagination.html" . }}
|
2019-03-31 20:28:38 +03:00
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ partial "comments.html" . }}
|
|
|
|
</div>
|
2019-01-28 03:11:02 +03:00
|
|
|
{{ end }}
|