From 3246bdbbdeb7314f742714b39eaef59cc94ab82c Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Fri, 19 Jun 2026 12:22:34 +0200 Subject: [PATCH] WIP:fix2 --- src/components/BlogNav.astro | 23 +++++++++++-------- src/content.config.ts | 1 + .../2.1.1/create-mojo.html | 8 +++++++ .../2.1.1/drop-mojo.html | 8 +++++++ .../2.1.1/help-mojo.html | 8 +++++++ .../2.1.1/update-mojo.html | 8 +++++++ src/lib/projects.ts | 2 ++ 7 files changed, 48 insertions(+), 10 deletions(-) create mode 100644 src/content/projects/hibernate-maven-plugin/2.1.1/create-mojo.html create mode 100644 src/content/projects/hibernate-maven-plugin/2.1.1/drop-mojo.html create mode 100644 src/content/projects/hibernate-maven-plugin/2.1.1/help-mojo.html create mode 100644 src/content/projects/hibernate-maven-plugin/2.1.1/update-mojo.html diff --git a/src/components/BlogNav.astro b/src/components/BlogNav.astro index 8508f2aa..b398e671 100644 --- a/src/components/BlogNav.astro +++ b/src/components/BlogNav.astro @@ -57,15 +57,18 @@ function inSubtree(node: T, url: stri // A nav item is visible (not off) when it is: current, ancestor of current, // sibling of current (only when current is not a section-index node), or child of current. // `inPath` = inSubtree(node, currentUrl), pre-computed by the caller to avoid double traversal. +// `isAlias` = true for nav-only stub entries: isCurrent and isAncestor are suppressed so the +// alias is hidden in Classic layout when its page is active (the canonical entry handles that). function nodeOff( nodeUrl: string, parentUrl: string, inPath: boolean, currentParentUrl: string, currentIsNode: boolean, + isAlias = false, ): boolean { - const isCurrent = nodeUrl === currentUrl; - const isAncestor = inPath && !isCurrent; + const isCurrent = !isAlias && nodeUrl === currentUrl; + const isAncestor = !isAlias && inPath && !isCurrent; const isSibling = parentUrl === currentParentUrl && !currentIsNode; const isChild = parentUrl === currentUrl; return !(isCurrent || isAncestor || isSibling || isChild); @@ -142,8 +145,8 @@ const activeProjectCurrentIsNode = activeProjectCurrentNode?.isNode ?? false; // Partial application of nodeOff bound to the Projects subtree's current-page context const _projCurrentParentUrl = activeProjectCurrentParent?.url ?? ''; -const projNodeOff = (nodeUrl: string, parentUrl: string, inPath: boolean) => - nodeOff(nodeUrl, parentUrl, inPath, _projCurrentParentUrl, activeProjectCurrentIsNode); +const projNodeOff = (nodeUrl: string, parentUrl: string, inPath: boolean, isAlias = false) => + nodeOff(nodeUrl, parentUrl, inPath, _projCurrentParentUrl, activeProjectCurrentIsNode, isAlias); // ── Blog URL classification ──────────────────────────────────────────────────── const mainSections = [ @@ -355,10 +358,10 @@ const activeTagSlug = onTagTerm ? currentUrl.replace(/^\/tags\//, '').repl