Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion app/.starlight-template
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2b5292214e55efe3fd229b20efb2688c02ba6230
18ba3d0c1fdcd7e22275b2558e904844121bf78f
11 changes: 3 additions & 8 deletions app/app/src/utils/getSidebarConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down Expand Up @@ -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<Awaited<ReturnType<typeof loadConfig>>> = []
let sidebarConfigSlug: string | undefined = undefined
for (let i = slugSegments.length; i >= 0; --i)
{
const slugSegment = slugSegments.slice(0, i).join('/')
Expand All @@ -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(
Expand Down