Skip to content

Commit

Permalink
Merge pull request #586 from shibomb/fix/example-pages-jumpto-categor…
Browse files Browse the repository at this point in the history
…y-lowercase

FIX the category name for the JumpTo menu in the example child pages.
  • Loading branch information
limzykenneth authored Oct 8, 2024
2 parents 1a1bb0a + cc53b35 commit a4bd3b5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/pages/_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ export const generateJumpToState = async (
break;
case "examples":
categories = new Set(
localeEntries.map((entry) => getExampleCategory(entry.slug)),
localeEntries.map((entry) => getExampleCategory(entry.id)),
);
break;
default:
Expand Down Expand Up @@ -374,14 +374,15 @@ export const generateJumpToState = async (
// Examples are a special case where subentries are only shown if they are in the current category
if (
collectionType !== "examples" ||
category === getExampleCategory(currentEntrySlug)
category === getExampleCategory(currentEntrySlug) ||
category.toLowerCase() === getExampleCategory(currentEntrySlug)
) {
// Get all entries in the current category
let currentCategoryEntries = localeEntries.filter(
(entry) =>
category ===
(collectionType === "examples"
? getExampleCategory(entry.slug)
? getExampleCategory(entry.id)
: // @ts-expect-error - We know that the category exists because of the collection type
entry.data.category ?? ""),
);
Expand Down

0 comments on commit a4bd3b5

Please sign in to comment.