]> juplo.de Git - website/commitdiff
Vollständige Sitemap-Navigation: nav-leaf, strong-Breadcrumb, blog.html-Partial
authorKai Moritz <kai.milan.moritz@googlemail.com>
Fri, 5 Jun 2026 14:07:56 +0000 (14:07 +0000)
committerKai Moritz <kai.milan.moritz@googlemail.com>
Fri, 5 Jun 2026 14:07:56 +0000 (14:07 +0000)
Kernprinzip: HTML enthält immer alle Einträge (vollständige Sitemap).
CSS-Klassen steuern die Sichtbarkeit im Classic-Layout, das NONE-Layout
(kein CSS) zeigt damit automatisch die komplette Sitemap.

Änderungen:
- Neues `_partials/menu/blog.html`: kanonisches Menü-Partial für alle
  Blog-bezogenen Seiten; ersetzt die duplizierten inline menu-Blöcke in
  den 4 Blog-Templates (blog/section, archive/section, archive/year,
  archive/page)
- Blog-Artikel im HTML mit Klasse `nav-leaf` → im Classic ausgeblendet,
  im NONE-Layout sichtbar
- Jahres-Items: immer sichtbar außer auf /blog/ (dort `off`)
- Kategorien/Tags: `off` außer auf /blog/; einzelne Kategorien/Tag-Namen
  als `nav-leaf`-Items (ohne Artikel darunter)
- `tree.html`: `<strong>` innerhalb aktiver Pfad-Links für
  Breadcrumb-Markierung im NONE-Layout
- `screen/menu.scss`: `nav-leaf { display: none }` und
  `a.selected > strong { font-weight: normal }` (Classic bleibt visuell
  unverändert)
- CLAUDE.md: Architektur des Menü-Systems dokumentiert (CSS-Marker-
  Prinzip, Breadcrumb-Markierung, Blog-Menü-Logik)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
CLAUDE.md
assets/scss/screen/menu.scss
layouts/_partials/menu/blog.html
layouts/_partials/menu/tree.html
layouts/blog/archive/page.html
layouts/blog/archive/section.html
layouts/blog/archive/year.html
layouts/blog/section.html

index 0e3e86559ff532156ad502b87bce768a56498786..113fbd9f907c2ff691409e1e73c23f8857a4285e 100644 (file)
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -105,12 +105,43 @@ Binary von sass-lang.com. Hugo erkennt Dart Sass automatisch, wenn im PATH.
 
 Das Menü (`nav#nav`) ist bewusst am HTML-Ende platziert und funktioniert gleichzeitig als SEO-Sitemap. Details zum Konzept: siehe CLAUDE.md im Content-Repo.
 
-**Aktueller Stand der Menü-Templates:**
+### Grundprinzip: HTML immer vollständig, CSS steuert Sichtbarkeit
+
+Das HTML enthält **immer alle Einträge** (vollständige Sitemap). Die Sichtbarkeit im Classic-Layout wird ausschließlich über CSS-Klassen gesteuert:
+
+| CSS-Klasse | Bedeutung | Classic | NONE |
+|---|---|---|---|
+| `off` | Item liegt außerhalb des aktiven Navigationspfads | `display: none` | sichtbar |
+| `nav-leaf` | Blatt-Item, das im Menü nicht angezeigt werden soll (z.B. Blog-Artikel, einzelne Kategorien/Tags in der Blog-Navigation) | `display: none` | sichtbar |
+| `active` | Sub-Liste ist aufgeklappt (auf dem aktiven Pfad) | sichtbarer Margin-Top | keine CSS-Wirkung |
+| `selected` | Link gehört zum aktiven Breadcrumb-Pfad | andere Farbe + Präfix | keine CSS-Wirkung |
+
+### Breadcrumb-Markierung im NONE-Layout
+
+Items auf dem aktiven Breadcrumb-Pfad (current + ancestors) bekommen `<strong>` innerhalb des `<a>`-Elements:
+```html
+<a href="..." class="s selected"><strong>Titel</strong></a>
+```
+
+Im Classic-Layout wird das Bold durch die CSS-Regel
+`#submenu li.s > a.s.selected > strong { font-weight: normal; }`
+neutralisiert, sodass das Classic-Layout visuell unverändert bleibt.
+Im NONE-Layout (kein CSS) rendert der Browser `<strong>` als fett → sichtbare Pfad-Hervorhebung.
+
+### Aktueller Stand der Menü-Templates
+
 - `_partials/menu/default.html`: Generisches Menü für nicht-Blog-Seiten (nutzt `tree.html`)
-- `_partials/menu/tree.html`: Rekursives Partial für den Seitenbaum (mit Projects-Sichtbarkeitslogik)
-- Für Blog/Categories/Tags ist der Menü-Block direkt in den jeweiligen Layout-Dateien inline — das ist bewusstes technisches Debt, das konsolidiert werden soll.
+- `_partials/menu/tree.html`: Rekursives Partial für den Seitenbaum (mit Projects-Sichtbarkeitslogik); setzt `<strong>` für aktive Pfad-Items
+- `_partials/menu/blog.html`: Vollständiges Menü für alle Blog-bezogenen Seiten (`/blog/`, `/blog/archive/`, Jahr- und Artikel-Seiten); ersetzt die früheren Inline-`menu`-Blöcke in den 4 Blog-Templates
+- Für Categories/Tags ist der Menü-Block noch direkt in den jeweiligen Layout-Dateien inline — technisches Debt, das konsolidiert werden soll.
+
+### Blog-Menü-Logik (`blog.html`)
+
+- **Jahres-Items**: Nie `off` (immer sichtbar in Classic), außer auf der `/blog/`-Übersichtsseite
+- **Artikel-Items**: Immer `nav-leaf` (in Classic ausgeblendet, in NONE sichtbar)
+- **Kategorien/Tags**: `off` auf allen Blog-Seiten außer `/blog/` selbst; im NONE-Layout trotzdem sichtbar, inklusive der einzelnen Kategorie-/Tag-Namen als `nav-leaf`-Items (ohne die jeweiligen Artikel darunter)
 
-**Offene Aufgabe:** Den `menu`-Block aus den Einzeltemplates in ein einziges parametrisiertes Partial auslagern.
+**Offene Aufgabe:** Den `menu`-Block aus den Categories/Tags-Templates in das `blog.html`-Partial oder ein weiteres Partial konsolidieren.
 
 ## Shortcodes
 
index 0d8d8e59b43b37fab1474fab2cfc0e8dadfc0f13..bfafe871ec2cb117a444f1462cfe9878fb2f1f5f 100644 (file)
 {
   content: 'V ';
 }
+#submenu li.s.nav-leaf
+{
+  display: none;
+}
+#submenu li.s > a.s.selected > strong
+{
+  font-weight: normal;
+}
index ff6fdc2bdff0c890f7bca7fc99f73a317290f7e9..b0fd22d68f9a9b863bf69a107137b8f3851ee137 100644 (file)
@@ -1,4 +1,9 @@
-{{- $page := .page }}
+{{- $page := .page -}}
+{{- $blog := site.GetPage "/blog" -}}
+{{- $archive := site.GetPage "/blog/archive" -}}
+{{- $onBlog := eq $page $blog -}}
+{{- $archiveSelected := or (eq $page $archive) ($page.IsDescendant $archive) -}}
+{{- $blogSelected := or $onBlog $archiveSelected -}}
 <nav id="nav">
   <hr class="n"/>
   <a class="hide" href="#top" title="Show Content">Jump back to the top of the page</a>
     {{- with site.GetPage "section" . }}
     {{- if eq .Path "/blog" }}
     <li class="s sub">
-      <a  href="{{ .RelPermalink }}" class="s selected">{{ .LinkTitle }}</a>
-      <ul class="s">
-        {{- range .Pages -}}
-        <li class="s">
-          <a href="{{ .RelPermalink }}" class="s{{ if or (eq . $page) (eq .LinkTitle ($page.Date | time.Format "2006")) }}
-) }} selected{{ end }}">{{ .LinkTitle }}</a>
+      <a href="{{ $blog.RelPermalink }}" class="s{{ if $blogSelected }} selected{{ end }}">{{ if $blogSelected }}<strong>{{ $blog.LinkTitle }}</strong>{{ else }}{{ $blog.LinkTitle }}{{ end }}</a>
+      <ul class="s{{ if $blogSelected }} active{{ end }}">
+        <li class="s sub">
+          <a href="{{ $archive.RelPermalink }}" class="s{{ if $archiveSelected }} selected{{ end }}">{{ if $archiveSelected }}<strong>{{ $archive.LinkTitle }}</strong>{{ else }}{{ $archive.LinkTitle }}{{ end }}</a>
+          <ul class="s{{ if $archiveSelected }} active{{ end }}">
+            {{- range $archive.Pages -}}
+            {{- $isActiveYear := or (eq . $page) ($page.IsDescendant .) -}}
+            <li class="s sub{{ if $onBlog }} off{{ end }}">
+              <a href="{{ .RelPermalink }}" class="s{{ if $isActiveYear }} selected{{ end }}">{{ if $isActiveYear }}<strong>{{ .LinkTitle }}</strong>{{ else }}{{ .LinkTitle }}{{ end }}</a>
+              <ul class="s{{ if $isActiveYear }} active{{ end }}">
+                {{- range .Pages -}}
+                {{- $isCurrent := eq . $page -}}
+                <li class="s nav-leaf">
+                  <a href="{{ .RelPermalink }}" class="s{{ if $isCurrent }} selected{{ end }}">{{ if $isCurrent }}<strong>{{ .LinkTitle }}</strong>{{ else }}{{ .LinkTitle }}{{ end }}</a>
+                </li>
+                {{- end -}}
+              </ul>
+            </li>
+            {{- end -}}
+          </ul>
+        </li>
+        {{- with site.GetPage "/categories" -}}
+        <li class="s{{ if not $onBlog }} off{{ end }}">
+          <a href="{{ .RelPermalink }}" class="s">{{ .LinkTitle }}</a>
+          <ul class="s">
+            {{- range .Pages -}}
+            <li class="s nav-leaf">
+              <a href="{{ .RelPermalink }}" class="s">{{ .LinkTitle }}</a>
+            </li>
+            {{- end -}}
+          </ul>
+        </li>
+        {{- end -}}
+        {{- with site.GetPage "/tags" -}}
+        <li class="s{{ if not $onBlog }} off{{ end }}">
+          <a href="{{ .RelPermalink }}" class="s">{{ .LinkTitle }}</a>
+          <ul class="s">
+            {{- range .Pages -}}
+            <li class="s nav-leaf">
+              <a href="{{ .RelPermalink }}" class="s">{{ .LinkTitle }}</a>
+            </li>
+            {{- end -}}
+          </ul>
         </li>
-        {{ end }}
+        {{- end -}}
       </ul>
     </li>
     {{- else }}
-    <li class="s{{ if or .Pages .Sections}} sub{{ end }} off">
-      <a  href="{{ .RelPermalink }}" class="s">{{ .LinkTitle }}</a>
+    <li class="s{{ if or .Pages .Sections }} sub{{ end }} off">
+      <a href="{{ .RelPermalink }}" class="s">{{ .LinkTitle }}</a>
       <ul class="s">
-      {{- partial "menu/tree.html" (dict "pages" .Pages "page" $page) }}
+        {{- partial "menu/tree.html" (dict "pages" .Pages "page" $page) }}
       </ul>
     </li>
-    {{- end }}{{/* if */}}
-    {{- end }}{{/* with */}}
-    {{- end }}{{/* range */}}
+    {{- end }}
+    {{- end }}
+    {{- end }}
   </ul>
   <hr class="n"/>
 </nav>
index fc7b65d0d50d42f6d7cd37381e220f396027ed34..64b7871a2246e406941adc963222eb504a66233d 100644 (file)
@@ -12,8 +12,8 @@
     {{- if or $isNotAProject $isVisible $isSelectedProjectPage}}
     <li class="s{{ if or .Pages .Sections}} sub{{ end }}{{ if not (or $isCurrent $isAncestor (and $isSibling (not $page.IsNode)) $isChild) }} off{{ end }}">
       <a  href="{{ .RelPermalink }}"
-          class="s {{ if (or $isCurrent $isAncestor) }} selected{{ end }}"
-          >{{ .LinkTitle }}</a>
+          class="s{{ if (or $isCurrent $isAncestor) }} selected{{ end }}"
+          >{{ if (or $isCurrent $isAncestor) }}<strong>{{ .LinkTitle }}</strong>{{ else }}{{ .LinkTitle }}{{ end }}</a>
       {{ if or .Pages .Sections }}
       <ul class="s{{ if (or $isCurrent $isAncestor) }} active{{ end }}">
         {{- if .Pages }}
index bf88f382c491ee2df616bcbe020ca16327f62803..3991f3190377705f12d409505c8940a439c24444 100644 (file)
   {{ end }}
 {{ end }}
 {{- define "menu" }}
-{{- $page := $ }}
-<nav id="nav">
-  <hr class="n"/>
-  <a class="hide" href="#top" title="Show Content">Jump back to the top of the page</a>
-  <h1 class="nav">Navigation</h1>
-  <h2 class="nav menu">Section-Menu</h2>
-  <ul id="menu" class="cf">
-    {{- range $page.Site.MainSections }}
-    {{- $section := site.GetPage "section" . }}
-    <li class="m {{ . }}">
-      <a href="{{ $section.RelPermalink }}" class="{{ cond (eq $page.Section .) "m selected" "m" }}">{{ $section.LinkTitle }}</a>
-    </li>
-    {{- end }}
-  </ul>
-  <h2 class="nav submenu">
-    <a class="s selected" href="{{ site.Home.RelPermalink }}">Home</a>
-  </h2>
-  <ul id="submenu" class="s active">
-    {{- range $page.Site.MainSections }}
-    {{- with site.GetPage "section" . }}
-    {{- if eq .Path "/blog" }}
-    <li class="s sub">
-      <a  href="{{ .RelPermalink }}" class="s selected">{{ .LinkTitle }}</a>
-      <ul class="s active">
-        {{- range .Pages -}}
-        <li class="s sub">
-          <a href="{{ .RelPermalink }}" class="s selected">{{ .LinkTitle }}</a>
-          <ul class="s active">
-            {{- range .Pages -}}
-            <li class="s">
-              <a href="{{ .RelPermalink }}" class="s{{ if or (eq . $page) (eq .LinkTitle ($page.Date | time.Format "2006")) }} selected{{ end }}">{{ .LinkTitle }}</a>
-            </li>
-            {{ end }}
-          </ul>
-        </li>
-        <li class="s off">
-          {{- with $.Site.GetPage "/categories" -}}
-          <a href="{{ .RelPermalink }}" class="s">{{ .LinkTitle }}</a>
-          {{- end -}}
-        </li>
-        <li class="s off">
-          {{- with $.Site.GetPage "/tags" -}}
-          <a href="{{ .RelPermalink }}" class="s">{{ .LinkTitle }}</a>
-          {{- end -}}
-        </li>
-        {{ end }}
-      </ul>
-    </li>
-    {{- else }}
-    <li class="s{{ if or .Pages .Sections}} sub{{ end }} off">
-      <a  href="{{ .RelPermalink }}" class="s">{{ .LinkTitle }}</a>
-      <ul class="s">
-      {{- partial "menu/tree.html" (dict "pages" .Pages "page" $page) }}
-      </ul>
-    </li>
-    {{- end }}{{/* if */}}
-    {{- end }}{{/* with */}}
-    {{- end }}{{/* range */}}
-  </ul>
-  <hr class="n"/>
-</nav>
+{{- partial "menu/blog.html" (dict "page" $) }}
 {{- end }}{{/* end menu */}}
 {{ define "marginalcontent" }}
   {{ partial "terms.html" . }}
index 938d5f021abe7eb8f116efed65ed7d55134e35b6..b5eb80b2fd10080a13daff893940c20d44579f96 100644 (file)
 {{- end }}{{/* end main */}}
 
 {{- define "menu" }}
-{{- $page := $ }}
-<nav id="nav">
-  <hr class="n"/>
-  <a class="hide" href="#top" title="Show Content">Jump back to the top of the page</a>
-  <h1 class="nav">Navigation</h1>
-  <h2 class="nav menu">Section-Menu</h2>
-  <ul id="menu" class="cf">
-    {{- range $page.Site.MainSections }}
-    {{- $section := site.GetPage "section" . }}
-    <li class="m {{ . }}">
-      <a href="{{ $section.RelPermalink }}" class="{{ cond (eq $page.Section .) "m selected" "m" }}">{{ $section.LinkTitle }}</a>
-    </li>
-    {{- end }}
-  </ul>
-  <h2 class="nav submenu">
-    <a class="s selected" href="{{ site.Home.RelPermalink }}">Home</a>
-  </h2>
-  <ul id="submenu" class="s active">
-    {{- range $page.Site.MainSections }}
-    {{- with site.GetPage "section" . }}
-    {{- if eq .Path "/blog" }}
-    <li class="s sub">
-      <a  href="{{ .RelPermalink }}" class="s selected">{{ .LinkTitle }}</a>
-      <ul class="s active">
-        {{- range .Pages -}}
-        <li class="s sub">
-          <a href="{{ .RelPermalink }}" class="s selected">{{ .LinkTitle }}</a>
-          <ul class="s active">
-            {{- range .Pages -}}
-            <li class="s">
-              <a href="{{ .RelPermalink }}" class="s">{{ .LinkTitle }}</a>
-            </li>
-            {{ end }}
-          </ul>
-        </li>
-        <li class="s off">
-          {{- with $.Site.GetPage "/categories" -}}
-          <a href="{{ .RelPermalink }}" class="s">{{ .LinkTitle }}</a>
-          {{- end -}}
-        </li>
-        <li class="s off">
-          {{- with $.Site.GetPage "/tags" -}}
-          <a href="{{ .RelPermalink }}" class="s">{{ .LinkTitle }}</a>
-          {{- end -}}
-        </li>
-        {{ end }}
-      </ul>
-    </li>
-    {{- else }}
-    <li class="s{{ if or .Pages .Sections}} sub{{ end }} off">
-      <a  href="{{ .RelPermalink }}" class="s">{{ .LinkTitle }}</a>
-      <ul class="s">
-      {{- partial "menu/tree.html" (dict "pages" .Pages "page" $page) }}
-      </ul>
-    </li>
-    {{- end }}{{/* if */}}
-    {{- end }}{{/* with */}}
-    {{- end }}{{/* range */}}
-  </ul>
-  <hr class="n"/>
-</nav>
+{{- partial "menu/blog.html" (dict "page" $) }}
 {{- end }}{{/* end menu */}}
index 6c8900c6dfe56a128e2002d81833a9d02655b176..e1c3b0eabb95f1c6184e8997a790635229fe5d6e 100644 (file)
 {{- end }}{{/* end main */}}
 
 {{- define "menu" }}
-{{- $page := $ }}
-<nav id="nav">
-  <hr class="n"/>
-  <a class="hide" href="#top" title="Show Content">Jump back to the top of the page</a>
-  <h1 class="nav">Navigation</h1>
-  <h2 class="nav menu">Section-Menu</h2>
-  <ul id="menu" class="cf">
-    {{- range $page.Site.MainSections }}
-    {{- $section := site.GetPage "section" . }}
-    <li class="m {{ . }}">
-      <a href="{{ $section.RelPermalink }}" class="{{ cond (eq $page.Section .) "m selected" "m" }}">{{ $section.LinkTitle }}</a>
-    </li>
-    {{- end }}
-  </ul>
-  <h2 class="nav submenu">
-    <a class="s selected" href="{{ site.Home.RelPermalink }}">Home</a>
-  </h2>
-  <ul id="submenu" class="s active">
-    {{- range $page.Site.MainSections }}
-    {{- with site.GetPage "section" . }}
-    {{- if eq .Path "/blog" }}
-    <li class="s sub">
-      <a  href="{{ .RelPermalink }}" class="s selected">{{ .LinkTitle }}</a>
-      <ul class="s active">
-        {{- range .Pages -}}
-        <li class="s sub">
-          <a href="{{ .RelPermalink }}" class="s selected">{{ .LinkTitle }}</a>
-          <ul class="s active">
-            {{- range .Pages -}}
-            <li class="s">
-              <a href="{{ .RelPermalink }}" class="s{{ if or (eq . $page) (eq .LinkTitle ($page.Date | time.Format "2006")) }} selected{{ end }}">{{ .LinkTitle }}</a>
-            </li>
-            {{ end }}
-          </ul>
-        </li>
-        <li class="s off">
-          {{- with $.Site.GetPage "/categories" -}}
-          <a href="{{ .RelPermalink }}" class="s">{{ .LinkTitle }}</a>
-          {{- end -}}
-        </li>
-        <li class="s off">
-          {{- with $.Site.GetPage "/tags" -}}
-          <a href="{{ .RelPermalink }}" class="s">{{ .LinkTitle }}</a>
-          {{- end -}}
-        </li>
-        {{ end }}
-      </ul>
-    </li>
-    {{- else }}
-    <li class="s{{ if or .Pages .Sections}} sub{{ end }} off">
-      <a  href="{{ .RelPermalink }}" class="s">{{ .LinkTitle }}</a>
-      <ul class="s">
-      {{- partial "menu/tree.html" (dict "pages" .Pages "page" $page) }}
-      </ul>
-    </li>
-    {{- end }}{{/* if */}}
-    {{- end }}{{/* with */}}
-    {{- end }}{{/* range */}}
-  </ul>
-  <hr class="n"/>
-</nav>
+{{- partial "menu/blog.html" (dict "page" $) }}
 {{- end }}{{/* end menu */}}
index ff9c3cb609c4dd8fd8e8fe33e0d965914615060e..8ab9c649a6c5e5d93bae49ad02f74b63f5626340 100644 (file)
@@ -1,59 +1,6 @@
-{{ define "menu" }}
-{{- $page := $ }}
-<nav id="nav">
-  <hr class="n"/>
-  <a class="hide" href="#top" title="Show Content">Jump back to the top of the page</a>
-  <h1 class="nav">Navigation</h1>
-  <h2 class="nav menu">Section-Menu</h2>
-  <ul id="menu" class="cf">
-    {{- range $page.Site.MainSections }}
-    {{- $section := site.GetPage "section" . }}
-    <li class="m {{ . }}">
-      <a href="{{ $section.RelPermalink }}" class="{{ cond (eq $page.Section .) "m selected" "m" }}">{{ $section.LinkTitle }}</a>
-    </li>
-    {{- end }}
-  </ul>
-  <h2 class="nav submenu">
-    <a class="s selected" href="{{ site.Home.RelPermalink }}">Home</a>
-  </h2>
-  <ul id="submenu" class="s active">
-    {{- range $page.Site.MainSections }}
-    {{- with site.GetPage "section" . }}
-    {{- if eq .Path "/blog" }}
-    <li class="s sub">
-      <a  href="{{ .RelPermalink }}" class="s selected">{{ .LinkTitle }}</a>
-      <ul class="s active">
-        {{- range .Pages -}}
-        <li class="s sub">
-          <a href="{{ .RelPermalink }}" class="s">{{ .LinkTitle }}</a>
-        </li>
-        <li class="s">
-          {{- with $.Site.GetPage "/categories" -}}
-          <a href="{{ .RelPermalink }}" class="s">{{ .LinkTitle }}</a>
-          {{- end -}}
-        </li>
-        <li class="s">
-          {{- with $.Site.GetPage "/tags" -}}
-          <a href="{{ .RelPermalink }}" class="s">{{ .LinkTitle }}</a>
-          {{- end -}}
-        </li>
-        {{ end }}
-      </ul>
-    </li>
-    {{- else }}
-    <li class="s{{ if or .Pages .Sections}} sub{{ end }} off">
-      <a  href="{{ .RelPermalink }}" class="s">{{ .LinkTitle }}</a>
-      <ul class="s">
-      {{- partial "menu/tree.html" (dict "pages" .Pages "page" $page) }}
-      </ul>
-    </li>
-    {{- end }}{{/* if */}}
-    {{- end }}{{/* with */}}
-    {{- end }}{{/* range */}}
-  </ul>
-  <hr class="n"/>
-</nav>
-{{ end }}
+{{- define "menu" }}
+{{- partial "menu/blog.html" (dict "page" $) }}
+{{- end }}
 
 {{- define "article" }}
   <header><h1>Recently Published Articles</h1></header>