-
Notifications
You must be signed in to change notification settings - Fork 3
/
astro.config.mjs
121 lines (119 loc) · 3.25 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
import { defineConfig } from "astro/config";
import starlight from "@astrojs/starlight";
import react from "@astrojs/react";
import markdoc from "@astrojs/markdoc";
import keystatic from "@keystatic/astro";
import cloudflare from "@astrojs/cloudflare";
import { readdirSync } from "fs";
import svelte from "@astrojs/svelte";
import semverSort from "semver-sort";
function getOperations() {
const plugins = readdirSync("src/content/plugins");
return plugins.map((plugin) => {
const name = plugin;
const versions = readdirSync(`src/content/plugins/${name}`);
const versionNumbers = semverSort.desc(
versions.map((v) => v.match(/v\d+\.\d+\.\d+/g)[0]),
);
return {
label: name,
items: [
{ label: "Overview", link: `/plugins/${name}` },
...versionNumbers.map((v) => ({
label: v,
collapsed: true,
items: [
{
label: `Overview at ${v}`,
link: `/plugins/${name}/${v}`,
},
{
label: "Operations",
link: `/plugins/${name}/${v}/operations`,
},
{ label: "Modules", link: `/plugins/${name}/${v}/modules` },
{ label: "Data types", link: `/plugins/${name}/${v}/datatypes` },
{ label: "Model types", link: `/plugins/${name}/${v}/modeltypes` },
{
label: "Operation types",
link: `/plugins/${name}/${v}/operationtypes`,
},
// TODO add data types and things here too!
],
})),
],
};
});
}
// https://astro.build/config
export default defineConfig({
integrations: [
starlight({
title: "kiara",
editLink: {
baseUrl: "https://github.com/DHARPA-project/kiara-website/edit/main/",
},
customCss: ["./src/styles/custom.css"],
components: {
// override the default title component, to add in last modified time
PageTitle: './src/components/Title.astro',
},
social: {
github: "https://github.com/DHARPA-project/kiara-website",
},
sidebar: [
{
label: "Concepts",
autogenerate: {
directory: "concepts",
},
},
{
label: "Mini-app users",
collapsed: true,
autogenerate: {
directory: "mini-app-users",
},
},
{
label: "Module users",
autogenerate: {
directory: "module-users",
},
},
{
label: "Module writers",
collapsed: true,
autogenerate: {
directory: "module-writers",
},
},
{
label: "Developing kiara itself",
collapsed: true,
autogenerate: {
directory: "core-devs",
},
},
{
label: "Internal",
collapsed: true,
autogenerate: {
directory: "internal",
},
},
{
label: "Plugins",
collapsed: true,
items: [{ label: "Overview", link: "/plugins" }, ...getOperations()],
},
],
}),
react(),
markdoc({ allowHTML: true }),
keystatic(),
svelte(),
],
output: "hybrid",
adapter: cloudflare(),
});