From: Kai Moritz Date: Wed, 10 Dec 2025 18:51:38 +0000 (+0100) Subject: Templating für das Juplo-Layout überarbeitet X-Git-Tag: frontend--hugo--todo~22 X-Git-Url: https://juplo.de/gitweb/?a=commitdiff_plain;h=cfb033c8409bffc7aa80421da488b43f5f41b484;p=website Templating für das Juplo-Layout überarbeitet --- diff --git a/layouts/_partials/breadcrumb.html b/layouts/_partials/breadcrumb.html new file mode 100644 index 00000000..aeeceb88 --- /dev/null +++ b/layouts/_partials/breadcrumb.html @@ -0,0 +1,14 @@ + diff --git a/layouts/_partials/footer.html b/layouts/_partials/footer.html index a7cd916d..08fad685 100644 --- a/layouts/_partials/footer.html +++ b/layouts/_partials/footer.html @@ -1 +1,8 @@ -

Copyright {{ now.Year }}. All rights reserved.

+ diff --git a/layouts/_partials/header.html b/layouts/_partials/header.html index 7980a00e..78e6631a 100644 --- a/layouts/_partials/header.html +++ b/layouts/_partials/header.html @@ -1,2 +1,5 @@ -

{{ site.Title }}

-{{ partial "menu.html" (dict "menuID" "main" "page" .) }} + diff --git a/layouts/_partials/marginalcontent.html b/layouts/_partials/marginalcontent.html new file mode 100644 index 00000000..94f3697f --- /dev/null +++ b/layouts/_partials/marginalcontent.html @@ -0,0 +1,20 @@ + + diff --git a/layouts/_partials/menu.html b/layouts/_partials/menu.html index 14245b55..a8d39bd1 100644 --- a/layouts/_partials/menu.html +++ b/layouts/_partials/menu.html @@ -1,51 +1,77 @@ -{{- /* -Renders a menu for the given menu ID. - -@context {page} page The current page. -@context {string} menuID The menu ID. - -@example: {{ partial "menu.html" (dict "menuID" "main" "page" .) }} -*/}} - {{- $page := .page }} {{- $menuID := .menuID }} -{{- with index site.Menus $menuID }} - -{{- end }} - -{{- define "_partials/inline/menu/walk.html" }} - {{- $page := .page }} - {{- range .menuEntries }} - {{- $attrs := dict "href" .URL }} - {{- if $page.IsMenuCurrent .Menu . }} - {{- $attrs = merge $attrs (dict "class" "active" "aria-current" "page") }} - {{- else if $page.HasMenuCurrent .Menu .}} - {{- $attrs = merge $attrs (dict "class" "ancestor" "aria-current" "true") }} - {{- end }} - {{- $name := .Name }} - {{- with .Identifier }} - {{- with T . }} - {{- $name = . }} - {{- end }} + diff --git a/layouts/baseof.html b/layouts/baseof.html index 39dcbec6..0bb66c6e 100644 --- a/layouts/baseof.html +++ b/layouts/baseof.html @@ -3,15 +3,21 @@ {{ partial "head.html" . }} - -
- {{ partial "header.html" . }} -
-
- {{ block "main" . }}{{ end }} -
- + +
+ {{- partial "header.html" . }} + {{- partial "breadcrumb.html" . }} +
+
+

{{ .Title }}

+ {{- block "main" . }}{{ end }} +
+
+ {{- partial "menu.html" (dict "menuID" "main" "page" .) }} + {{- partial "marginalcontent.html" . }} +
+
+ {{- partial "footer.html" . }} +
diff --git a/layouts/page.html b/layouts/page.html index 7e286c80..30fcf482 100644 --- a/layouts/page.html +++ b/layouts/page.html @@ -1,6 +1,4 @@ {{ define "main" }} -

{{ .Title }}

- {{ $dateMachine := .Date | time.Format "2006-01-02T15:04:05-07:00" }} {{ $dateHuman := .Date | time.Format ":date_long" }} diff --git a/layouts/section.html b/layouts/section.html index 4cfd224d..e0e83081 100644 --- a/layouts/section.html +++ b/layouts/section.html @@ -1,4 +1,3 @@ {{ define "main" }} -

{{ .Title }}

{{ .Content }} {{ end }} diff --git a/layouts/term.html b/layouts/term.html index c2e78751..7c5437dd 100644 --- a/layouts/term.html +++ b/layouts/term.html @@ -1,5 +1,4 @@ {{ define "main" }} -

{{ .Title }}

{{ .Content }} {{ range .Pages }}

{{ .LinkTitle }}