diff options
author | Nicholas Johnson <nick@nicksphere.ch> | 2022-09-03 00:00:00 +0000 |
---|---|---|
committer | Nicholas Johnson <nick@nicksphere.ch> | 2022-09-03 00:00:00 +0000 |
commit | a4d5e5baaa06245d03f1a0dccb6246287b94a7781d0a79af0a393b4197108fab (patch) | |
tree | 3255d3c127b33cc31c2503928a88effaa23450dcf01827a46b26d924f328d709 | |
parent | e01f5c393adc7f72cf6e9bf20d2382e2ea098d8d19e3d607635138b98d74fca9 (diff) | |
download | hugo-theme-journal-a4d5e5baaa06245d03f1a0dccb6246287b94a7781d0a79af0a393b4197108fab.tar.gz hugo-theme-journal-a4d5e5baaa06245d03f1a0dccb6246287b94a7781d0a79af0a393b4197108fab.zip |
Give all pages an h1 heading based on their title
-rw-r--r-- | TODO | 1 | ||||
-rw-r--r-- | layouts/_default/single.gmi | 1 | ||||
-rw-r--r-- | layouts/_default/single.html | 1 |
3 files changed, 2 insertions, 1 deletions
@@ -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 }} |