feat(website): add api openapi spec

This commit is contained in:
Lars Hampe 2024-09-28 21:27:06 +02:00
parent 766fa918e5
commit 04e2164419
3 changed files with 14 additions and 1 deletions

View File

@ -1,5 +1,6 @@
import starlight from '@astrojs/starlight' import starlight from '@astrojs/starlight'
import { defineConfig } from 'astro/config' import { defineConfig } from 'astro/config'
import starlightOpenAPI, { openAPISidebarGroups } from 'starlight-openapi'
export default defineConfig({ export default defineConfig({
outDir: '../../build/website', outDir: '../../build/website',
@ -25,11 +26,22 @@ export default defineConfig({
label: 'Guides', label: 'Guides',
items: [{ label: 'Getting started', slug: 'guides/getting-started' }], items: [{ label: 'Getting started', slug: 'guides/getting-started' }],
}, },
...openAPISidebarGroups,
// { // {
// label: 'Reference', // label: 'Reference',
// autogenerate: { directory: 'reference' }, // autogenerate: { directory: 'reference' },
// }, // },
], ],
plugins: [
// Generate the OpenAPI documentation pages.
starlightOpenAPI([
{
base: 'api',
label: 'API',
schema: 'https://api.boring.tools/openapi.json',
},
]),
],
}), }),
], ],
}) })

View File

@ -10,10 +10,11 @@
"astro": "astro" "astro": "astro"
}, },
"dependencies": { "dependencies": {
"@astrojs/check": "^0.9.3",
"@astrojs/starlight": "^0.28.2", "@astrojs/starlight": "^0.28.2",
"astro": "^4.15.3", "astro": "^4.15.3",
"sharp": "^0.32.5", "sharp": "^0.32.5",
"@astrojs/check": "^0.9.3", "starlight-openapi": "^0.7.0",
"typescript": "^5.6.2" "typescript": "^5.6.2"
} }
} }

BIN
bun.lockb

Binary file not shown.