summaryrefslogtreecommitdiff
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
parente01f5c393adc7f72cf6e9bf20d2382e2ea098d8d19e3d607635138b98d74fca9 (diff)
downloadhugo-theme-journal-a4d5e5baaa06245d03f1a0dccb6246287b94a7781d0a79af0a393b4197108fab.tar.gz
hugo-theme-journal-a4d5e5baaa06245d03f1a0dccb6246287b94a7781d0a79af0a393b4197108fab.zip
Give all pages an h1 heading based on their title
-rw-r--r--TODO1
-rw-r--r--layouts/_default/single.gmi1
-rw-r--r--layouts/_default/single.html1
3 files changed, 2 insertions, 1 deletions
diff --git a/TODO b/TODO
index de047a0..39f9bee 100644
--- a/TODO
+++ b/TODO
@@ -1,5 +1,4 @@
- put date written somewhere in page
-- give all pages an h1 heading based on their title
- add tag support
- fix "layouts/_default/single.gmi" changing preformatted text
- add support for inline elements for HTML
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 }}