From 28e367915f43780a9c15a986445fee0cf5abf837 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sun, 14 Jun 2026 08:57:10 +0000 Subject: [PATCH] =?utf8?q?Navigation=20f=C3=BCr=20About-Seiten=20erg=C3=A4?= =?utf8?q?nzt;=20off-Klassen-Logik=20korrigiert?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit BlogNav.astro: About-Eintrag in #submenu hinzugefügt. off-Logik der Blog- und About-Sektion basiert jetzt auf den Hugo-Template-Quellen (frontend-Branch): - blogSectionOff = onAbout (aus tree.html: section-index blendet andere Sections aus) - aboutOff = blogSelected (aus blog.html: alle Non-Blog-Sections immer off) Auf Homepage und regulären Root-Seiten (Impressum, Datenschutz) sind beide Sections sichtbar — wie in Hugo (Kind-/Geschwister-Logik). about.html.astro, impressum.html.astro, datenschutz.html.astro: menu-Slot mit BlogNav befüllt. Co-Authored-By: Claude Sonnet 4.6 --- src/components/BlogNav.astro | 16 +++++++++++++++- src/pages/about.html.astro | 5 +++++ src/pages/datenschutz.html.astro | 5 +++++ src/pages/impressum.html.astro | 5 +++++ 4 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/components/BlogNav.astro b/src/components/BlogNav.astro index a4df2f6e..a75a4631 100644 --- a/src/components/BlogNav.astro +++ b/src/components/BlogNav.astro @@ -62,6 +62,7 @@ const onTagsIndex = currentUrl === '/blog/tags/'; const onTagTerm = currentUrl.startsWith('/tags/'); const blogSelected = onBlog || onArchive || onCategoriesIndex || onCategoryTerm || onTagsIndex || onTagTerm; +const onAbout = currentUrl === '/about.html'; // Active state flags const categoriesSelected = onCategoriesIndex || onCategoryTerm; @@ -81,6 +82,13 @@ const activeSection = mainSections.find(s => { return currentUrl.startsWith(s.url); })?.name ?? ''; +// Hugo blog.html: Blog always visible on blog pages, all other sections always off. +// Hugo default.html + tree.html: on Homepage/regular-root-pages all sections visible +// (child/sibling logic); on About section-index only About visible, Blog off. +// When Projects is implemented, extend both: blogSectionOff |= onProjects, aboutOff |= onProjects. +const blogSectionOff = onAbout; +const aboutOff = blogSelected; + // Determine active year from currentUrl function isActiveYear(year: string) { return currentUrl === `/blog/archive/${year}/` || @@ -109,7 +117,7 @@ const activeTagSlug = onTagTerm ? currentUrl.replace(/^\/tags\//, '').replace(/\ + {/* About entry */} +
  • + + {onAbout ? About : 'About'} + +

  • diff --git a/src/pages/about.html.astro b/src/pages/about.html.astro index aeb3904e..8b9f125b 100644 --- a/src/pages/about.html.astro +++ b/src/pages/about.html.astro @@ -1,6 +1,7 @@ --- import BaseLayout from '../layouts/BaseLayout.astro'; import Breadcrumb from '../components/Breadcrumb.astro'; +import BlogNav from '../components/BlogNav.astro'; const crumbs = [ { title: 'Home', url: '/' }, @@ -53,6 +54,10 @@ const crumbs = [

    + + + +