Skip to content

Commit

Permalink
Merge pull request #589 from shibomb/fix/fix-jumpto-category-id-examp…
Browse files Browse the repository at this point in the history
…le-child-pages

Fix example category link in the jumpTo on the example detail page.
  • Loading branch information
Qianqianye authored Oct 8, 2024
2 parents d24bb80 + 6b3eb25 commit 8268ec4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/pages/_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,9 +365,13 @@ export const generateJumpToState = async (
// Loop through each category and add entries to the jumpToLinks
for (const category of categories ?? []) {
const categoryLinks = [] as JumpToLink[];
const categoryLabel = getCategoryLabel(category);
categoryLinks.push({
label: getCategoryLabel(category),
url: `/${collectionType}#${category}`,
label: categoryLabel,
url:
collectionType === "examples"
? `/${collectionType}/#${categoryLabel.toLowerCase()}`
: `/${collectionType}/#${category}`,
current: false,
});

Expand Down

0 comments on commit 8268ec4

Please sign in to comment.