-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathastro.config.mjs
85 lines (81 loc) · 1.91 KB
/
astro.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import { readFileSync } from "node:fs";
import { defineConfig } from "astro/config";
import starlight from "@astrojs/starlight";
import { apiModules } from "./docs/utils";
const rescriptTM = JSON.parse(
readFileSync("./docs/assets/rescript.tmLanguage.json", "utf-8"),
);
const apiSidebarItems = apiModules.map(({ moduleName, link, items }) => {
const nestedItems = Object.values(items).map(({ moduleName, link }) => ({
label: moduleName,
link
}));
return ({
label: moduleName,
collapsed: true,
items: [
{
label: `Overview`,
link
},
...nestedItems
]
});
});
export default defineConfig({
srcDir: "docs",
publicDir: "docs/public",
site: "https://rescript-lang.github.io",
base: "experimental-rescript-webapi",
integrations: [
starlight({
title: "Experimental WebAPI",
logo: {
src: "./docs/assets/rescript-logo.svg",
},
social: {
github: "https://github.com/rescript-lang/experimental-rescript-webapi",
},
editLink: {
baseUrl:
"https://github.com/rescript-lang/experimental-rescript-webapi/edit/main/",
},
sidebar: [
{
slug: "",
},
{
slug: "design-philosophy",
},
{
label: "Examples",
link: "examples",
},
{
slug: "project-status",
},
{
label: "Contributing",
autogenerate: { directory: "contributing" },
},
{
label: "API Documentation",
collapsed: true,
items: [
{
label: "Overview",
link: "apidocs",
},
...apiSidebarItems,
],
},
],
customCss: ["./docs/styles/fonts.css", "./docs/styles/theme.css"],
expressiveCode: {
shiki: {
langs: [rescriptTM],
},
},
}),
],
});