diff --git a/app/.starlight-template b/app/.starlight-template index 5bc57a1..5f93c1c 100644 --- a/app/.starlight-template +++ b/app/.starlight-template @@ -1 +1 @@ -2b5292214e55efe3fd229b20efb2688c02ba6230 +18ba3d0c1fdcd7e22275b2558e904844121bf78f diff --git a/app/app/src/utils/getSidebarConfig.ts b/app/app/src/utils/getSidebarConfig.ts index e494e6e..e47c09e 100644 --- a/app/app/src/utils/getSidebarConfig.ts +++ b/app/app/src/utils/getSidebarConfig.ts @@ -3,9 +3,9 @@ import path from 'node:path' import { getCollection, getEntry } from 'astro:content' import { getRelativeLocaleUrl } from 'astro:i18n' +import type { DataEntryMap } from 'astro:content' import type { SidebarEntry } from '@astrojs/starlight/utils/routing/types' import type { StarlightUserConfig } from '@astrojs/starlight/types' -import type { DataEntryMap } from 'astro:content' const SIDEBAR_CONFIG_ROOT = path.resolve('./src/content/docs') @@ -272,8 +272,8 @@ export async function getSidebarConfig( // slugPath may be empty for the root path (home page) const slugSegments = slugPath.split('/').filter(Boolean) - let sidebarConfig = undefined - let sidebarConfigSlug = undefined + let sidebarConfig: NonNullable>> = [] + let sidebarConfigSlug: string | undefined = undefined for (let i = slugSegments.length; i >= 0; --i) { const slugSegment = slugSegments.slice(0, i).join('/') @@ -287,11 +287,6 @@ export async function getSidebarConfig( } } - if (!sidebarConfig) - { - throw new Error(`Sidebar config not found for path '${slugPath}'`) - } - return Promise.all( sidebarConfig.map( item => formatSidebarItem(