|
1 |
| -import { defineConfig } from 'astro/config'; |
2 |
| -import starlight from '@astrojs/starlight'; |
| 1 | +import { defineConfig } from "astro/config" |
| 2 | +import starlight from "@astrojs/starlight" |
| 3 | +import { generateAPI } from "starlight-openapi" |
| 4 | + |
| 5 | +// Generate the documentation and get the associated sidebar groups. |
| 6 | +const { openAPISidebarGroups, starlightOpenAPI } = await generateAPI([ |
| 7 | + { |
| 8 | + base: "api", |
| 9 | + label: "API Reference", |
| 10 | + schema: process.env.API_SCHEMA ?? "./schemas/public.json", |
| 11 | + }, |
| 12 | +]) |
3 | 13 |
|
4 | 14 | // https://astro.build/config
|
5 | 15 | export default defineConfig({
|
6 |
| - integrations: [ |
7 |
| - starlight({ |
8 |
| - title: 'My Docs', |
9 |
| - social: { |
10 |
| - github: 'https://github.com/withastro/starlight', |
11 |
| - }, |
12 |
| - sidebar: [ |
13 |
| - { |
14 |
| - label: 'Guides', |
15 |
| - items: [ |
16 |
| - // Each item here is one entry in the navigation menu. |
17 |
| - { label: 'Example Guide', link: '/guides/example/' }, |
18 |
| - ], |
19 |
| - }, |
20 |
| - { |
21 |
| - label: 'Reference', |
22 |
| - autogenerate: { directory: 'reference' }, |
23 |
| - }, |
24 |
| - ], |
25 |
| - }), |
26 |
| - ], |
27 |
| -}); |
| 16 | + integrations: [ |
| 17 | + starlight({ |
| 18 | + title: "Eventpop Public API Documentation", |
| 19 | + social: { |
| 20 | + github: "https://github.com/eventpop", |
| 21 | + }, |
| 22 | + sidebar: [ |
| 23 | + { |
| 24 | + label: "Guides", |
| 25 | + items: [ |
| 26 | + // Each item here is one entry in the navigation menu. |
| 27 | + { label: "Example Guide", link: "/guides/example/" }, |
| 28 | + ], |
| 29 | + }, |
| 30 | + // { |
| 31 | + // label: "Reference", |
| 32 | + // autogenerate: { directory: "reference" }, |
| 33 | + // }, |
| 34 | + ...openAPISidebarGroups, |
| 35 | + ], |
| 36 | + }), |
| 37 | + |
| 38 | + // Add the Starlight OpenAPI integration. |
| 39 | + starlightOpenAPI(), |
| 40 | + ], |
| 41 | +}) |
0 commit comments