From: Kai Moritz Date: Fri, 19 Jun 2026 10:22:34 +0000 (+0200) Subject: WIP:fix2 X-Git-Url: https://juplo.de/gitweb/?a=commitdiff_plain;h=3246bdbbdeb7314f742714b39eaef59cc94ab82c;p=website WIP:fix2 --- 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