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

58 lines
1.8 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">
2023-06-09 22:27:17 +00:00
{{- .Date.Format "2006-01-02" -}}
{{- if $.Site.Params.showLastUpdated -}}
[{{- or $.Site.Params.updatedDatePrefix "Updated" -}} :: {{- .Lastmod.Format "2006-01-02" -}}]
{{- 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" }} ({{ .WordCount }} {{ $.Site.Params.words | default "words" }})</span>
{{- 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">
<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">&#8983;</a> ${3}` | safeHTML }}
</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 }}