]> juplo.de Git - website/commitdiff
Navigation für About-Seiten ergänzt; off-Klassen-Logik korrigiert
authorKai Moritz <kai.milan.moritz@googlemail.com>
Sun, 14 Jun 2026 08:57:10 +0000 (08:57 +0000)
committerKai Moritz <kai.milan.moritz@googlemail.com>
Sun, 14 Jun 2026 08:57:10 +0000 (08:57 +0000)
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 <noreply@anthropic.com>
src/components/BlogNav.astro
src/pages/about.html.astro
src/pages/datenschutz.html.astro
src/pages/impressum.html.astro

index a4df2f6e8496d8de93e9c92cae3706a049cc723e..a75a4631b071a8dd2d51f5566096b1d8b20a681a 100644 (file)
@@ -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(/\
   </h2>
   <ul id="submenu" class="s active">
     {/* Blog subtree */}
-    <li class="s sub">
+    <li class={`s sub${blogSectionOff ? ' off' : ''}`}>
       <a href="/blog/" class={blogSelected ? 's selected' : 's'}>
         {blogSelected ? <strong>Blog</strong> : 'Blog'}
       </a>
@@ -211,6 +219,12 @@ const activeTagSlug = onTagTerm ? currentUrl.replace(/^\/tags\//, '').replace(/\
         )}
       </ul>
     </li>
+    {/* About entry */}
+    <li class={`s${aboutOff ? ' off' : ''}`}>
+      <a href="/about.html" class={onAbout ? 's selected' : 's'}>
+        {onAbout ? <strong>About</strong> : 'About'}
+      </a>
+    </li>
   </ul>
   <hr class="n"/>
 </nav>
index aeb3904e61a7c0da6129c2b103617b40855e911e..8b9f125b1e9b989f18a0d33976ebf9f726a1fb8d 100644 (file)
@@ -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 = [
     </p>
   </Fragment>
 
+  <Fragment slot="menu">
+    <BlogNav currentUrl="/about.html" />
+  </Fragment>
+
   <Fragment slot="marginalcontent">
     <aside class="m">
       <h2>Funded by the Europian Union</h2>
index 6772e17c43e5f3b1d31e522ad516b2b632a70661..9e404ce02899cb6e652dfbbe13bceafb8b0fb996 100644 (file)
@@ -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: '/' },
@@ -102,6 +103,10 @@ const crumbs = [
     </section>
   </Fragment>
 
+  <Fragment slot="menu">
+    <BlogNav currentUrl="/datenschutz.html" />
+  </Fragment>
+
   <Fragment slot="footerlinks">
     <li class="f"><a class="f" href="/impressum.html">Impressum</a></li>
     <li class="f"><strong class="f">Datenschutz</strong></li>
index ed9c01b90fcb6caf69002bef74fa15e0b8373490..c762d42e971ed002ecdbd4a58bd255c6779454d2 100644 (file)
@@ -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: '/' },
@@ -35,6 +36,10 @@ const crumbs = [
     </p>
   </Fragment>
 
+  <Fragment slot="menu">
+    <BlogNav currentUrl="/impressum.html" />
+  </Fragment>
+
   <Fragment slot="footerlinks">
     <li class="f"><strong class="f">Impressum</strong></li>
     <li class="f"><a class="f" href="/datenschutz.html">Datenschutz</a></li>