55 lines
1.6 KiB
HTML
Raw Normal View History

2019-01-28 01:11:02 +01:00
{{ define "main" }}
2019-03-31 19:28:38 +02:00
<div class="post">
<h1 class="post-title">
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1>
<div class="post-meta">
{{ if .Params.Date }}
2019-03-21 08:40:07 +09:00
<span class="post-date">
2021-10-24 10:43:59 +02:00
{{ .Date.Format "2006-01-02" }}
{{ if $.Site.Params.showLastUpdated }}
[{{or $.Site.Params.updatedDatePrefix "Updated"}}: {{ .Lastmod.Format "2006-01-02" }}]
{{ end }}
2019-03-21 08:40:07 +09:00
</span>
{{ end }}
2019-03-31 19:28:38 +02:00
{{ with .Params.Author }}
2021-10-24 10:43:59 +02: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 01:11:02 +01:00
{{ end }}
2019-03-31 19:28:38 +02:00
</div>
2019-01-28 01:11:02 +01:00
2019-03-31 19:28:38 +02:00
{{ if .Params.tags }}
<span class="post-tags">
{{ range .Params.tags }}
2019-04-05 08:18:21 +02:00
#<a href="{{ (urlize (printf "tags/%s/" .)) | absLangURL }}">{{ . }}</a>&nbsp;
2019-01-28 01:11:02 +01:00
{{ end }}
2019-03-31 19:28:38 +02:00
</span>
{{ end }}
{{ partial "cover.html" . }}
2019-03-21 08:40:07 +09:00
2022-02-05 15:58:12 +05:30
{{ if (.Params.Toc | default .Site.Params.Toc) }}
2019-03-21 08:40:07 +09:00
<div class="table-of-contents">
<h2>
2022-02-05 15:58:12 +05:30
{{ (.Params.TocTitle | default .Site.Params.TocTitle) | default "Table of Contents" }}
</h2>
2019-03-21 08:40:07 +09:00
{{ .TableOfContents }}
</div>
2019-03-31 19:28:38 +02:00
{{ end }}
2019-03-31 19:18:08 +02:00
2019-03-31 19:28:38 +02:00
<div class="post-content">
{{- with .Content -}}
2020-01-17 13:11:41 +01:00
<div>
2020-01-24 08:21:30 +01:00
{{ . | replaceRE "(<h[1-9] id=\"([^\"]+)\".+)(</h[1-9]+>)" `${1}<a href="#${2}" class="hanchor" ariaLabel="Anchor">&#8983;</a> ${3}` | safeHTML }}
2020-01-17 13:11:41 +01:00
</div>
2020-01-24 08:21:30 +01:00
{{- end -}}
2019-01-28 01:11:02 +01:00
</div>
2019-03-21 08:40:07 +09:00
{{ if eq .Type $.Site.Params.contentTypeName }}
{{ partial "posts_pagination.html" . }}
2019-03-31 19:28:38 +02:00
{{ end }}
{{ partial "comments.html" . }}
</div>
2019-01-28 01:11:02 +01:00
{{ end }}