Skip to content

Commit

Permalink
Merge pull request #62 from HiDeoo/hd-sidebar-slugs
Browse files Browse the repository at this point in the history
  • Loading branch information
HiDeoo authored Nov 8, 2024
2 parents e41a380 + 16f931b commit 93bf268
Show file tree
Hide file tree
Showing 6 changed files with 674 additions and 599 deletions.
4 changes: 2 additions & 2 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
"lint": "prettier -c --cache . && eslint . --cache --max-warnings=0"
},
"dependencies": {
"@astrojs/starlight": "0.24.4",
"@astrojs/starlight": "0.25.0",
"@hideoo/starlight-plugins-docs-components": "^0.2.2",
"astro": "4.11.1",
"astro": "4.16.10",
"sharp": "0.32.6"
},
"engines": {
Expand Down
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 example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"lint": "prettier -c --cache . && eslint . --cache --max-warnings=0"
},
"dependencies": {
"@astrojs/starlight": "0.24.4",
"astro": "4.11.1",
"@astrojs/starlight": "0.25.0",
"astro": "4.16.10",
"sharp": "0.32.6",
"starlight-typedoc": "workspace:*",
"typedoc": "0.26.5",
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
7 changes: 3 additions & 4 deletions packages/starlight-typedoc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,16 @@
"github-slugger": "2.0.0"
},
"devDependencies": {
"@astrojs/starlight": "0.24.4",
"@astrojs/starlight": "0.25.0",
"@playwright/test": "1.35.0",
"@types/node": "18.16.16",
"astro": "4.11.1",
"astro": "4.16.10",
"cross-env": "7.0.3",
"typescript": "5.1.6",
"vitest": "1.0.4"
},
"peerDependencies": {
"@astrojs/starlight": ">=0.15.0",
"astro": ">=4.0.0",
"@astrojs/starlight": ">=0.25.0",
"typedoc": ">=0.26.5",
"typedoc-plugin-markdown": ">=4.1.1"
},
Expand Down
Loading

0 comments on commit 93bf268

Please sign in to comment.