From 2c5b18f3585e1a1a24518ac7b74cd1e39880074f Mon Sep 17 00:00:00 2001 From: Matiboux Date: Thu, 14 Aug 2025 00:30:17 +0200 Subject: [PATCH 1/2] Set starlight template commit hash --- app/.starlight-template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 5a76f8b11c34d4397050d3f1fd79c9c07183b858 Mon Sep 17 00:00:00 2001 From: Matiboux Date: Thu, 14 Aug 2025 00:31:04 +0200 Subject: [PATCH 2/2] Update getSidebarConfig --- app/app/src/utils/getSidebarConfig.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) 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(