forked from anomalyco/opencode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathastro.config.mjs
More file actions
120 lines (115 loc) · 2.81 KB
/
astro.config.mjs
File metadata and controls
120 lines (115 loc) · 2.81 KB
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
// @ts-check
import { defineConfig } from "astro/config"
import starlight from "@astrojs/starlight"
import solidJs from "@astrojs/solid-js"
import cloudflare from "@astrojs/cloudflare"
import theme from "toolbeam-docs-theme"
import config from "./config.mjs"
import { rehypeHeadingIds } from "@astrojs/markdown-remark"
import rehypeAutolinkHeadings from "rehype-autolink-headings"
import { spawnSync } from "child_process"
const github = "https://github.com/sst/opencode"
// https://astro.build/config
export default defineConfig({
site: config.url,
output: "server",
adapter: cloudflare({
imageService: "passthrough",
}),
devToolbar: {
enabled: false,
},
server: {
host: "0.0.0.0",
},
markdown: {
rehypePlugins: [rehypeHeadingIds, [rehypeAutolinkHeadings, { behavior: "wrap" }]],
},
build: {},
integrations: [
configSchema(),
solidJs(),
starlight({
title: "opencode",
lastUpdated: true,
expressiveCode: { themes: ["github-light", "github-dark"] },
social: [
{ icon: "github", label: "GitHub", href: config.github },
{ icon: "discord", label: "Dscord", href: config.discord },
],
head: [
{
tag: "link",
attrs: {
rel: "icon",
href: "/favicon.svg",
},
},
],
editLink: {
baseUrl: `${github}/edit/dev/packages/web/`,
},
markdown: {
headingLinks: false,
},
customCss: ["./src/styles/custom.css"],
logo: {
light: "./src/assets/logo-light.svg",
dark: "./src/assets/logo-dark.svg",
replacesTitle: true,
},
sidebar: [
"docs",
"docs/config",
"docs/providers",
"docs/enterprise",
"docs/troubleshooting",
{
label: "Usage",
items: [
"docs/cli",
"docs/ide",
"docs/share",
"docs/github",
]
},
{
label: "Configure",
items: [
"docs/modes",
"docs/rules",
"docs/agents",
"docs/models",
"docs/themes",
"docs/keybinds",
"docs/mcp-servers",
]
}
],
components: {
Hero: "./src/components/Hero.astro",
Head: "./src/components/Head.astro",
Header: "./src/components/Header.astro",
},
plugins: [
theme({
headerLinks: config.headerLinks,
}),
],
}),
],
redirects: {
"/discord": "https://discord.gg/opencode",
},
})
function configSchema() {
return {
name: "configSchema",
hooks: {
"astro:build:done": async () => {
console.log("generating config schema")
spawnSync("../opencode/script/schema.ts", ["./dist/config.json"])
},
},
}
}