Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/pages/_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ export const generateJumpToState = async (
category === getExampleCategory(currentEntrySlug)
) {
// Get all entries in the current category
const currentCategoryEntries = localeEntries.filter(
let currentCategoryEntries = localeEntries.filter(
(entry) =>
category ===
(collectionType === "examples"
Expand All @@ -386,6 +386,14 @@ export const generateJumpToState = async (
entry.data.category ?? ""),
);

if (collectionType === "tutorials") {
currentCategoryEntries = currentCategoryEntries.sort(
(a, b) =>
((a.data as any).categoryIndex ?? 1000) -
((b.data as any).categoryIndex ?? 1000),
);
}

// Add the entries in the category to the jumpToLinks
categoryLinks.push(
...currentCategoryEntries.map(
Expand Down