Skip to content

Commit 831331c

Browse files
devin-ai-integration[bot]kenny@buildwithfern.comkennyderek
authored
fix(docs): landing page routing for productgroup sites (#6170)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: [email protected] <[email protected]> Co-authored-by: Kenny Derek <[email protected]>
1 parent f8e0427 commit 831331c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

packages/fdr-sdk/src/navigation/utils/findNode.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,15 @@ export function findNode(root: FernNavigation.RootNode, slug: FernNavigation.Slu
101101
}
102102
}
103103

104+
// if we still haven't found a matching product or version, check if the slug matches
105+
// the productgroup's landing page (only if no product matched to avoid collisions)
106+
if (!foundProductNode && isProductGroupNode(root.child) && root.child.landingPage != null) {
107+
const landingPageSlug = root.child.landingPage.slug;
108+
if (slug === landingPageSlug) {
109+
return { type: "redirect", redirect: landingPageSlug };
110+
}
111+
}
112+
104113
return {
105114
type: "notFound",
106115
// External product links don't have pointsTo, only internal products and versions do

0 commit comments

Comments
 (0)