diff --git a/src/pages/_utils.ts b/src/pages/_utils.ts index 2ae7261c70..14ef5874ae 100644 --- a/src/pages/_utils.ts +++ b/src/pages/_utils.ts @@ -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" @@ -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(