Skip to content

Commit

Permalink
fix: fixes compatibility issue with Starlight 0.25.0 new sidebar li…
Browse files Browse the repository at this point in the history
…nks syntax
  • Loading branch information
HiDeoo committed Nov 8, 2024
1 parent 9d00e58 commit 16f931b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion example/astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default defineConfig({
sidebar: [
{
label: 'Guides',
items: [{ label: 'Example Guide', link: '/guides/example/' }],
items: ['guides/example'],
},
typeDocSidebarGroup,
],
Expand Down
4 changes: 2 additions & 2 deletions packages/starlight-typedoc/libs/starlight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function getSidebarGroupFromReflections(
.flatMap((group) => {
if (group.title === 'Modules') {
return group.children.map((child) => {
if (!child.url) {
if (!child.url || child.variant === 'document') {
return undefined
}

Expand Down Expand Up @@ -230,7 +230,7 @@ export function getStarlightTypeDocOutputDirectory(outputDirectory: string, base
}

function isSidebarManualGroup(item: NonNullable<StarlightUserConfigSidebar>[number]): item is SidebarManualGroup {
return 'items' in item
return typeof item === 'object' && 'items' in item
}

function isReferenceReflectionGroup(group: ReflectionGroup) {
Expand Down

0 comments on commit 16f931b

Please sign in to comment.