Skip to content

Commit d60828d

Browse files
committed
Include Eventpop API json
1 parent 4c4970e commit d60828d

File tree

5 files changed

+565
-36
lines changed

5 files changed

+565
-36
lines changed

astro.config.mjs

Lines changed: 38 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,41 @@
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+
])
313

414
// https://astro.build/config
515
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+
})

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
"dependencies": {
1313
"@astrojs/starlight": "^0.10.4",
1414
"astro": "^3.2.2",
15-
"sharp": "^0.32.6"
15+
"sharp": "^0.32.6",
16+
"shiki": "^0.14.4",
17+
"starlight-openapi": "^0.2.1"
1618
}
1719
}

0 commit comments

Comments
 (0)