Skip to content

Commit

Permalink
fix: The category name is displayed with Lower case in JumpTo Sidebar…
Browse files Browse the repository at this point in the history
… on Example Detail page.
  • Loading branch information
shibomb committed Oct 7, 2024
1 parent d1cae09 commit cc53b35
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 cc53b35

Please sign in to comment.