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

43 lines
1.1 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>
{{ partial "post-meta.html" . }}
2022-06-21 13:50:51 +00:00
{{ 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 }}