hugo-theme-terminal/layouts/_default/single.html

61 lines
1.9 KiB
HTML
Raw Normal View History

2022-06-21 13:50:51 +00:00
{{ define "main" }}
2022-10-22 11:29:33 +00:00
<article class="post">
2022-06-21 13:50:51 +00:00
<h1 class="post-title">
2022-10-22 11:29:33 +00:00
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
</h1>
2022-06-21 13:50:51 +00:00
<div class="post-meta">
2023-06-09 22:27:17 +00:00
{{- if .Date -}}
2022-10-22 11:29:33 +00:00
<time class="post-date">
{{- partial "post-date" . -}}
2024-11-22 18:19:48 +00:00
{{- if and $.Site.Params.showLastUpdated .Lastmod -}}
&nbsp;{{- partial "post-lastmod" . -}}
2023-06-09 22:27:17 +00:00
{{- end -}}
2022-10-22 11:29:33 +00:00
</time>
2023-06-09 22:27:17 +00:00
{{- end -}}
{{- with .Params.Author -}}
<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" }}</span>
{{- end -}}
{{- if and (.Param "showWordCount") (eq (.Param "showWordCount") true) -}}
<span class="post-word-count">{{ .WordCount }} {{ $.Site.Params.words | default "words" }}</span>
2023-06-09 22:27:17 +00:00
{{- end -}}
2022-06-21 13:50:51 +00:00
</div>
{{ if .Params.tags }}
2022-10-22 11:29:33 +00:00
<span class="post-tags">
{{ range .Params.tags }}
#<a href="{{ (urlize (printf "tags/%s/" .)) | absLangURL }}">{{ . }}</a>&nbsp;
{{ end }}
</span>
2022-06-21 13:50:51 +00:00
{{ end }}
{{ partial "cover.html" . }}
{{ if (.Params.Toc | default .Site.Params.Toc) }}
<div class="table-of-contents">
<h1>
2022-06-21 13:50:51 +00:00
{{ (.Params.TocTitle | default .Site.Params.TocTitle) | default "Table of Contents" }}
</h1>
2022-06-21 13:50:51 +00:00
{{ .TableOfContents }}
</div>
{{ end }}
<div class="post-content">
{{- with .Content -}}
<div>
2024-08-20 10:11:39 +00:00
{{ . | replaceRE "(<h[1-9] id=\"([^\"]+)\".+)(</h[1-9]+>)" `${1}<a href="#${2}" class="hanchor" ariaLabel="Anchor">#</a> ${3}` | safeHTML }}
2022-06-21 13:50:51 +00:00
</div>
{{- end -}}
</div>
{{ if eq .Type $.Site.Params.contentTypeName }}
2022-10-22 11:29:33 +00:00
{{ partial "posts_pagination.html" . }}
2022-06-21 13:50:51 +00:00
{{ end }}
{{ if not (.Params.hideComments | default false) }}
2022-10-22 11:29:33 +00:00
{{ partial "comments.html" . }}
2022-06-21 13:50:51 +00:00
{{ end }}
2022-10-22 11:29:33 +00:00
</article>
2022-06-21 13:50:51 +00:00
{{ end }}