From 7f7248e2b78087c464dd62cc9b3016770e53aa84 Mon Sep 17 00:00:00 2001 From: Muhammad Zain Tariq <49867382+mzaintariq@users.noreply.github.com> Date: Sat, 24 Jan 2026 15:33:54 +0500 Subject: [PATCH 1/3] Update build-site-navigation.ts --- .../core/src/lib/build-site-navigation.ts | 58 +++++++++++-------- 1 file changed, 34 insertions(+), 24 deletions(-) diff --git a/examples/core/src/lib/build-site-navigation.ts b/examples/core/src/lib/build-site-navigation.ts index fe3191d5..335a9807 100644 --- a/examples/core/src/lib/build-site-navigation.ts +++ b/examples/core/src/lib/build-site-navigation.ts @@ -50,6 +50,7 @@ function constructTree( name: hierarchy.attributes?.name!, id: hierarchy.id!, slug: hierarchy.attributes?.slug, + parentName: "", }), ) .map(async (hierarchy) => { @@ -72,29 +73,29 @@ function constructTree( // Build 2nd level by finding all 'child nodes' belonging to each first level featured-nodes const directs = directChildren.data?.data ? directChildren.data.data.slice(0, 4).map((child) => { - const children: ISchema[] = allNodes.data?.data - ? allNodes.data.data - .filter( - (node) => node?.relationships?.parent?.data.id === child.id, - ) - .map((node) => - createNode({ - name: node.attributes?.name!, - id: node.id!, - slug: node.attributes?.slug, - hrefBase: `${hierarchy.href}/${child.attributes?.slug}`, - }), - ) - : []; + const children: ISchema[] = allNodes.data?.data + ? allNodes.data.data + .filter( + (node) => node?.relationships?.parent?.data.id === child.id, + ) + .map((node) => + createNode({ + name: node.attributes?.name!, + id: node.id!, + slug: node.attributes?.slug, + parentName: `${hierarchy.name} > ${child.attributes?.name}`, + }), + ) + : []; - return createNode({ - name: child.attributes?.name!, - id: child.id!, - slug: child.attributes?.slug, - hrefBase: hierarchy.href, - children, - }); - }) + return createNode({ + name: child.attributes?.name!, + id: child.id!, + slug: child.attributes?.slug, + parentName: hierarchy.name, + children, + }); + }) : []; return { ...hierarchy, children: directs }; @@ -117,12 +118,21 @@ function createNode({ slug = "missing-slug", hrefBase = "", children = [], -}: CreateNodeDefinition): ISchema { + parentName = "", +}: CreateNodeDefinition & { parentName?: string }): ISchema { + const hierarchicalPath = parentName + ? `${parentName} > ${name}` + : name; + const segments = hierarchicalPath.split(" > ").filter(Boolean); + const urlPath = segments.length > 0 + ? "/" + segments.map(segment => encodeURIComponent(segment)).join("/") + : ""; + return { name, id, slug, - href: `${hrefBase}/${slug}`, + href: `${hrefBase}/${urlPath}`, children, }; } From dc28feff5fb2c5c8ae0f6ffc73bd76290ce30801 Mon Sep 17 00:00:00 2001 From: Muhammad Zain Tariq <49867382+mzaintariq@users.noreply.github.com> Date: Sat, 24 Jan 2026 16:03:48 +0500 Subject: [PATCH 2/3] Update NavBarPopover.tsx --- .../header/navigation/NavBarPopover.tsx | 45 +++++++++---------- 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/examples/core/src/components/header/navigation/NavBarPopover.tsx b/examples/core/src/components/header/navigation/NavBarPopover.tsx index 59df4fe0..87d5b03c 100644 --- a/examples/core/src/components/header/navigation/NavBarPopover.tsx +++ b/examples/core/src/components/header/navigation/NavBarPopover.tsx @@ -22,22 +22,22 @@ export function NavBarPopover({
{item.name} {item.children.map((child: NavigationNode) => ( - { + e.preventDefault(); + window.location.href = `/search${child.href}`; + }} > - - {child.name} - - - ))} - - - Browse All + {child.name} - + ))} + { + e.preventDefault(); + window.location.href = `/search${item.href}`; + }}> + Browse All +
); }; @@ -63,16 +63,13 @@ export function NavBarPopover({ )}
- - - Browse All {item.name} - - - + { + e.preventDefault(); + window.location.href = `/search${item.href}`; + }}> + Browse All {item.name} + + From 76c2f4afa2133d686b255f4477bf1b4952473508 Mon Sep 17 00:00:00 2001 From: Muhammad Zain Tariq <49867382+mzaintariq@users.noreply.github.com> Date: Mon, 26 Jan 2026 15:25:21 +0500 Subject: [PATCH 3/3] fix key error --- examples/core/src/components/header/navigation/NavBarPopover.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/core/src/components/header/navigation/NavBarPopover.tsx b/examples/core/src/components/header/navigation/NavBarPopover.tsx index 87d5b03c..335bba73 100644 --- a/examples/core/src/components/header/navigation/NavBarPopover.tsx +++ b/examples/core/src/components/header/navigation/NavBarPopover.tsx @@ -23,6 +23,7 @@ export function NavBarPopover({ {item.name} {item.children.map((child: NavigationNode) => ( { e.preventDefault();