From a4d5e5baaa06245d03f1a0dccb6246287b94a7781d0a79af0a393b4197108fab Mon Sep 17 00:00:00 2001 From: Nicholas Johnson Date: Sat, 3 Sep 2022 00:00:00 +0000 Subject: Give all pages an h1 heading based on their title --- TODO | 1 - layouts/_default/single.gmi | 1 + layouts/_default/single.html | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) 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 @@

🔗 Return to homepage

+

{{ .Name }}

{{ .Content -}}
{{- end }} -- cgit v1.2.3