aboutsummaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
authorNicholas Johnson <nick@nicksphere.ch>2022-09-03 00:00:00 +0000
committerNicholas Johnson <nick@nicksphere.ch>2022-09-03 00:00:00 +0000
commita4d5e5baaa06245d03f1a0dccb6246287b94a7781d0a79af0a393b4197108fab (patch)
tree3255d3c127b33cc31c2503928a88effaa23450dcf01827a46b26d924f328d709 /layouts
parente01f5c393adc7f72cf6e9bf20d2382e2ea098d8d19e3d607635138b98d74fca9 (diff)
downloadhugo-theme-journal-a4d5e5baaa06245d03f1a0dccb6246287b94a7781d0a79af0a393b4197108fab.tar.gz
hugo-theme-journal-a4d5e5baaa06245d03f1a0dccb6246287b94a7781d0a79af0a393b4197108fab.zip
Give all pages an h1 heading based on their title
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/single.gmi1
-rw-r--r--layouts/_default/single.html1
2 files changed, 2 insertions, 0 deletions
diff --git a/layouts/_default/single.gmi b/layouts/_default/single.gmi
index 93501e0..c1d8bf2 100644
--- a/layouts/_default/single.gmi
+++ b/layouts/_default/single.gmi
@@ -2,6 +2,7 @@
=> ./{{ replaceRE ".+?/" "../" .RelPermalink | safeURL }} 🔗 Return to homepage
+# {{ .Name | safeHTML }}
{{ $content := .RawContent }}
{{- $content = $content | replaceRE `\n####{0,3}` "\n###" }}
{{- $content = $content | replaceRE `\n\[(.+?)\]\((.+?)\)` "\n=> $2 $1" }}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 83ed937..a9fc62b 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -3,6 +3,7 @@
<p id="return"><a href="/" rel="noreferrer">🔗 Return to homepage</a></p>
</nav>
<main>
+ <h1 id="{{ .File.TranslationBaseName }}">{{ .Name }}</h1>
{{ .Content -}}
</main>
{{- end }}