Skip to content

Commit 8268ec4

Browse files
authored
Merge pull request #589 from shibomb/fix/fix-jumpto-category-id-example-child-pages
Fix example category link in the jumpTo on the example detail page.
2 parents d24bb80 + 6b3eb25 commit 8268ec4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/pages/_utils.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,9 +365,13 @@ export const generateJumpToState = async (
365365
// Loop through each category and add entries to the jumpToLinks
366366
for (const category of categories ?? []) {
367367
const categoryLinks = [] as JumpToLink[];
368+
const categoryLabel = getCategoryLabel(category);
368369
categoryLinks.push({
369-
label: getCategoryLabel(category),
370-
url: `/${collectionType}#${category}`,
370+
label: categoryLabel,
371+
url:
372+
collectionType === "examples"
373+
? `/${collectionType}/#${categoryLabel.toLowerCase()}`
374+
: `/${collectionType}/#${category}`,
371375
current: false,
372376
});
373377

0 commit comments

Comments
 (0)