From 21524b4b253d6a3c7ba581c3c313347f36bfc612 Mon Sep 17 00:00:00 2001 From: Ludo Date: Sat, 11 Apr 2026 18:37:47 +0200 Subject: [PATCH] =?UTF-8?q?refactor:=20standardize=20all=20Hugo=20template?= =?UTF-8?q?s=20=E2=80=94=20consistent=20landmark=20structure?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All templates now follow: body > nav > article > header + content + footer Removed: -
(redundant, header+h1+p serves same purpose) -
(article is the content landmark) - role="main" on article (incorrect ARIA) - header block in baseof (header now inside article) Standardized: default, docs, essay, notes, console, page, list, index. Co-Authored-By: Claude Opus 4.6 (1M context) --- site/layouts/_default/baseof.html | 3 +- site/layouts/_default/list.html | 44 ++++++++------- site/layouts/_default/single.html | 50 +++++++++++------ site/layouts/console/single.html | 90 +++++++----------------------- site/layouts/docs/single.html | 28 ++++------ site/layouts/essay/single.html | 56 +++++++++---------- site/layouts/index.html | 22 ++++---- site/layouts/layouts/list.html | 19 +++---- site/layouts/notes/single.html | 92 ++++++------------------------- site/layouts/page/single.html | 10 ++-- 10 files changed, 156 insertions(+), 258 deletions(-) diff --git a/site/layouts/_default/baseof.html b/site/layouts/_default/baseof.html index 7943483..247f65d 100644 --- a/site/layouts/_default/baseof.html +++ b/site/layouts/_default/baseof.html @@ -5,10 +5,9 @@ {{ partial "nav.html" . }} - {{ block "header" . }}{{ end }} {{ block "content" . }}{{ end }} diff --git a/site/layouts/_default/list.html b/site/layouts/_default/list.html index 16ef30c..337881b 100644 --- a/site/layouts/_default/list.html +++ b/site/layouts/_default/list.html @@ -1,24 +1,26 @@ -{{ define "header" }} -
-

{{ .Title }}

- {{ with .Description }}

{{ . }}

{{ end }} -
-{{ end }} - {{ define "content" }} -
-
- {{ range .Pages }} -
-
-

{{ .Title }}

-

- -

-
- {{ with .Summary }}

{{ . }}

{{ end }} -
- {{ end }} -
+
+
+

{{ .Title }}

+ {{- with .Description }} +

{{ . }}

+ {{- end }} +
+ + {{ .Content }} + + {{ range .Pages }} +
+
+

{{ .Title }}

+ {{- if not .Date.IsZero }} +

+ +

+ {{- end }} +
+ {{- with .Description }}

{{ . }}

{{ end }} +
+ {{ end }}
{{ end }} diff --git a/site/layouts/_default/single.html b/site/layouts/_default/single.html index 2f47e13..98355f9 100644 --- a/site/layouts/_default/single.html +++ b/site/layouts/_default/single.html @@ -1,23 +1,39 @@ -{{ define "header" }} -
- {{ with .Type }}

{{ . }}

{{ end }} -

- - {{ with .Params.author }} · {{ . }}{{ end }} -

- {{ with .Params.tags }} -

{{ range . }}#{{ . }} {{ end }}

- {{ end }} -
-{{ end }} - {{ define "content" }} -
+
+
+

{{ .Title }}

+ {{- with .Description }} +

{{ . }}

+ {{- end }} + {{- if or (not .Date.IsZero) .Params.author }} +

+ {{- if not .Date.IsZero -}} + + {{- end -}} + {{- if and (not .Date.IsZero) .Params.author }} · {{ end -}} + {{- with .Params.author }}{{ . }}{{ end -}} +

+ {{- end }} + {{- with .GetTerms "tags" }} + + {{- end }} +
+ {{ .Content }} - {{ with .Params.footer }} + + {{- if or .PrevInSection .NextInSection }} - {{ end }} + {{- end }}
{{ end }} diff --git a/site/layouts/console/single.html b/site/layouts/console/single.html index d4ed500..8347338 100644 --- a/site/layouts/console/single.html +++ b/site/layouts/console/single.html @@ -1,87 +1,37 @@ -{{ define "header" }} -
- {{- if .Description -}} -
-

{{ .Title }}

-

{{ .Description }}

-
- {{- else -}} -

{{ .Title }}

- {{- end }} -
-{{ end }} - {{ define "content" }}
{{- with .TableOfContents -}} {{- end -}} diff --git a/site/layouts/docs/single.html b/site/layouts/docs/single.html index f335f88..0fafb33 100644 --- a/site/layouts/docs/single.html +++ b/site/layouts/docs/single.html @@ -1,16 +1,3 @@ -{{ define "header" }} -
- {{- if .Description -}} -
-

{{ .Title }}

-

{{ .Description }}

-
- {{- else -}} -

{{ .Title }}

- {{- end }} -
-{{ end }} - {{ define "content" }}
@@ -32,20 +19,25 @@
+
+

{{ .Title }}

+ {{- with .Description }} +

{{ . }}

+ {{- end }} +
+ {{ .Content }} {{- if or .PrevInSection .NextInSection -}} -