From 0cbfc6e379fba96e2ef69d262697092ff9bf7deb Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sun, 19 Apr 2026 15:00:18 +0200 Subject: [PATCH] =?utf8?q?WIP:Projekte=20sind=20nur=20im=20Men=C3=BC=20ver?= =?utf8?q?linkt,=20wenn=20`visible=3Dtrue`,=20oder=20ausgew=C3=A4hlt?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit WIP: visible: true -> current: true WIP: hibernate-... neu generieren * Unter dem Menü-Eintrag für `/projects/` erscheinen nur Projekte, für die im Frontmatter der Parameter `visible` explizit auf `true gesetzt ist. * Alle anderen Unterseiten von `/projects/` werden im Menü nicht angezeigt. * *Ausnahme:* Die Seite ist gerade ausgewählt -- _Diese Ausnahme ist nötig, da ansonsten kein Menü-Pfad mehr für nicht sichtbare Projekte (aka: die Dokumentation älterer oder unveröffentlichter Projekt-Versionen) angezeigt wird. --- .../content/projects/hibernate-maven-plugin/_index.html | 2 ++ layouts/_partials/menu/tree.html | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/exampleSite/content/projects/hibernate-maven-plugin/_index.html b/exampleSite/content/projects/hibernate-maven-plugin/_index.html index 40d2ffdb..85b0b43f 100644 --- a/exampleSite/content/projects/hibernate-maven-plugin/_index.html +++ b/exampleSite/content/projects/hibernate-maven-plugin/_index.html @@ -3,6 +3,8 @@ title: Hibernate Maven Plugin weight: 0 url: /hibernate-maven-plugin/ layout: article +params: + visible: true ---

Hibernate Maven Plugin

diff --git a/layouts/_partials/menu/tree.html b/layouts/_partials/menu/tree.html index a3d63ed2..e8e30814 100644 --- a/layouts/_partials/menu/tree.html +++ b/layouts/_partials/menu/tree.html @@ -5,6 +5,11 @@ {{- $isAncestor := $page.IsDescendant . -}} {{- $isChild := $parent.Eq $page }} {{- $isSibling := $parent.Eq (index $page.Ancestors 0) }} + {{- $projects := .GetPage "/projects" }} + {{- $isNotAProject := not (hasPrefix .Path "/projects/") }} + {{- $isVisible := .Params.visible | default false }} + {{- $isSelectedProjectPage := or (.Eq $page) $isAncestor (and $isSibling (not ($parent.Eq $projects))) (and $isChild (not ($parent.Eq $projects))) }} + {{- if or $isNotAProject $isVisible $isSelectedProjectPage}}