www-jmbit-de/hugo/themes/terminal/layouts/_default/single.html

58 lines
1.7 KiB
HTML
Raw Normal View History

2023-08-03 11:21:34 +02:00
{{ define "main" }}
<article class="post">
<h1 class="post-title">
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
</h1>
<div class="post-meta">
{{- if .Date -}}
2023-08-03 11:21:34 +02:00
<time class="post-date">
{{- partial "post-date" . -}}
{{- if and $.Site.Params.showLastUpdated .Lastmod -}}
&nbsp;{{- partial "post-lastmod" . -}}
{{- end -}}
2023-08-03 11:21:34 +02:00
</time>
{{- end -}}
{{- with .Params.Author -}}
2023-08-03 11:21:34 +02:00
<span class="post-author">{{ . }}</span>
{{- end -}}
{{- if and (.Param "readingTime") (eq (.Param "readingTime") true) -}}
<span class="post-reading-time">{{ .ReadingTime }} {{ $.Site.Params.minuteReadingTime | default "min read" }} ({{ .WordCount }} {{ $.Site.Params.words | default "words" }})</span>
{{- end -}}
2023-08-03 11:21:34 +02:00
</div>
{{ if .Params.tags }}
<span class="post-tags">
{{ range .Params.tags }}
#<a href="{{ (urlize (printf "tags/%s/" .)) | absLangURL }}">{{ . }}</a>&nbsp;
{{ end }}
</span>
{{ end }}
{{ partial "cover.html" . }}
{{ 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 }}
2023-08-03 11:21:34 +02:00
</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 }}