59 lines
2.3 KiB
HTML
59 lines
2.3 KiB
HTML
{{ define "main" }}
|
|
<article class="post">
|
|
<h1 class="post-title">
|
|
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
|
|
</h1>
|
|
<div class="post-meta">
|
|
{{- if .Date -}}
|
|
<time class="post-date">
|
|
{{- .Date.Format "2006-01-02" -}}
|
|
{{- if $.Site.Params.showLastUpdated -}}
|
|
[{{- or $.Site.Params.updatedDatePrefix "Updated" -}} :: {{- .Lastmod.Format "2006-01-02" -}}]
|
|
{{- end -}}
|
|
</time>
|
|
{{- end -}}
|
|
{{- with .Params.Author -}}
|
|
<span class="post-author">{{ . }}</span>
|
|
{{- end -}}
|
|
{{- if and (.Param "ShowReadingTime") (eq (.Param "ShowReadingTime") true) -}}{{ $customReadingTime := div (float .WordCount) .Site.Params.readingSpeed }}{{ $customReadingTime = math.Ceil $customReadingTime }}<!-- (browsers insert spaces sometimes)
|
|
--><span class="post-reading-time">{{ $customReadingTime }} {{ if eq $customReadingTime 1 }}{{ $.Site.Params._minute | default "minute" }}{{ else }}{{ $.Site.Params._minutes | default "minutes" }}{{ end }} {{$.Site.Params._readingTime | default "to read" }} ({{ .WordCount }} {{ if eq .WordCount 1 }}{{ $.Site.Params._word | default "word" }}{{ else }}{{ $.Site.Params._words | default "words" }}{{ end }})</span>
|
|
{{- end -}}
|
|
<!-- comments counter -->{{ partial "comments_counter.html" . }}
|
|
</div>
|
|
|
|
{{ if .Params.tags }}
|
|
<span class="post-tags">
|
|
{{ range .Params.tags }}
|
|
#<a href="{{ (urls.JoinPath "tags" (urlize .) "/") | absLangURL }}">{{ . }}</a>
|
|
{{ end }}
|
|
</span>
|
|
{{ end }}
|
|
{{ partial "cover.html" (dict "ctx" . "isCoverCaptionEnabled" true) }}
|
|
|
|
{{ if (.Params.Toc | default .Site.Params.Toc) }}
|
|
<div class="table-of-contents">
|
|
<h2>
|
|
{{ (.Params.TocTitle | default .Site.Params.TocTitle) | default "Table of Contents" }}
|
|
</h2>
|
|
{{ .TableOfContents }}
|
|
</div>
|
|
{{ end }}
|
|
|
|
<div class="post-content">
|
|
{{- with .Content -}}
|
|
<div>
|
|
{{ . | replaceRE "(<h[1-9] id=\"([^\"]+)\".+)(</h[1-9]+>)" `${1}<a href="#${2}" class="hanchor" ariaLabel="Anchor">⌗</a> ${3}` | safeHTML }}
|
|
</div>
|
|
{{- end -}}
|
|
</div>
|
|
|
|
{{ if eq .Type $.Site.Params.contentTypeName }}
|
|
{{ partial "posts_pagination.html" . }}
|
|
{{ end }}
|
|
|
|
{{ if not (.Params.hideComments | default false) }}
|
|
{{ partial "comments.html" . }}
|
|
{{ end }}
|
|
</article>
|
|
{{ end }}
|