Skip to content

Commit a4bd3b5

Browse files
authored
Merge pull request #586 from shibomb/fix/example-pages-jumpto-category-lowercase
FIX the category name for the JumpTo menu in the example child pages.
2 parents 1a1bb0a + cc53b35 commit a4bd3b5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/pages/_utils.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ export const generateJumpToState = async (
339339
break;
340340
case "examples":
341341
categories = new Set(
342-
localeEntries.map((entry) => getExampleCategory(entry.slug)),
342+
localeEntries.map((entry) => getExampleCategory(entry.id)),
343343
);
344344
break;
345345
default:
@@ -374,14 +374,15 @@ export const generateJumpToState = async (
374374
// Examples are a special case where subentries are only shown if they are in the current category
375375
if (
376376
collectionType !== "examples" ||
377-
category === getExampleCategory(currentEntrySlug)
377+
category === getExampleCategory(currentEntrySlug) ||
378+
category.toLowerCase() === getExampleCategory(currentEntrySlug)
378379
) {
379380
// Get all entries in the current category
380381
let currentCategoryEntries = localeEntries.filter(
381382
(entry) =>
382383
category ===
383384
(collectionType === "examples"
384-
? getExampleCategory(entry.slug)
385+
? getExampleCategory(entry.id)
385386
: // @ts-expect-error - We know that the category exists because of the collection type
386387
entry.data.category ?? ""),
387388
);

0 commit comments

Comments
 (0)