Skip to content

Commit 66ac24b

Browse files
committed
fix: skip breadcrumb segments without directory entries instead of showing raw paths
1 parent 47b7dd4 commit 66ac24b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/components/Breadcrumbs/index.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,17 @@ function generateBreadcrumbs(
6767
if (url.includes('[platform]')) {
6868
href['query'] = { platform };
6969
}
70-
let label = directoryEntry ? directoryEntry.title : url;
7170

7271
const override = overrides[url]
7372
? overrides[url]
7473
: overrides[url.replace('[platform]', platform!)];
7574

76-
if (override) {
77-
label = override;
78-
}
75+
// Skip segments that have no directory entry and no override —
76+
// these are URL path segments that aren't navigable pages
77+
// (e.g. "add-aws-services" after flattening in the directory)
78+
if (!directoryEntry && !override) return;
79+
80+
const label = override || directoryEntry!.title;
7981

8082
breadcrumbs.push({
8183
href,

0 commit comments

Comments
 (0)