hugo-themes/cyberpink/layouts/_default/single.html

23 lines
657 B
HTML
Raw Permalink Normal View History

2024-02-10 20:53:59 +01:00
{{ define "main" }}
<div class="main-head">
<h1> {{ .Title | markdownify }} </h1>
</div>
{{ if .Params.image }}
<details open="">
<summary>Image</summary>
<figure class="postImage">
<a href="{{ .Site.BaseURL }}{{ .Params.image }}">
<img src="{{ .Site.BaseURL }}{{ .Params.image }}" alt="{{ .Params.imageDescription }}">
</a>
<figcaption>{{ .Params.imageDescription }}</figcaption>
</figure>
</details>
{{ end }}
<article class="post-content">
{{- with .Content -}}
{{ . | replaceRE "(<h[1-9] id=\"([^\"]+)\".+)(</h[1-9]+>)" `${1} <a href="#${2}" class="anchor" ariaLabel="Anchor">λ</a> ${3}` | safeHTML }}
{{- end -}}
</article>
{{ end }}