| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299 |
- // @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"
- // https://astro.build/config
- export default defineConfig({
- site: config.url,
- base: "/docs",
- 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",
- defaultLocale: "root",
- locales: {
- root: {
- label: "English",
- lang: "en",
- dir: "ltr",
- },
- ar: {
- label: "العربية",
- lang: "ar",
- dir: "rtl",
- },
- bs: {
- label: "Bosanski",
- lang: "bs-BA",
- dir: "ltr",
- },
- da: {
- label: "Dansk",
- lang: "da-DK",
- dir: "ltr",
- },
- de: {
- label: "Deutsch",
- lang: "de-DE",
- dir: "ltr",
- },
- es: {
- label: "Espa\u00f1ol",
- lang: "es-ES",
- dir: "ltr",
- },
- fr: {
- label: "Fran\u00e7ais",
- lang: "fr-FR",
- dir: "ltr",
- },
- it: {
- label: "Italiano",
- lang: "it-IT",
- dir: "ltr",
- },
- ja: {
- label: "日本語",
- lang: "ja-JP",
- dir: "ltr",
- },
- ko: {
- label: "한국어",
- lang: "ko-KR",
- dir: "ltr",
- },
- nb: {
- label: "Norsk Bokm\u00e5l",
- lang: "nb-NO",
- dir: "ltr",
- },
- pl: {
- label: "Polski",
- lang: "pl-PL",
- dir: "ltr",
- },
- "pt-br": {
- label: "Portugu\u00eas (Brasil)",
- lang: "pt-BR",
- dir: "ltr",
- },
- ru: {
- label: "Русский",
- lang: "ru-RU",
- dir: "ltr",
- },
- th: {
- label: "ไทย",
- lang: "th-TH",
- dir: "ltr",
- },
- tr: {
- label: "T\u00fcrk\u00e7e",
- lang: "tr-TR",
- dir: "ltr",
- },
- "zh-cn": {
- label: "简体中文",
- lang: "zh-CN",
- dir: "ltr",
- },
- "zh-tw": {
- label: "繁體中文",
- lang: "zh-TW",
- dir: "ltr",
- },
- },
- favicon: "/favicon-v3.svg",
- head: [
- {
- tag: "link",
- attrs: {
- rel: "icon",
- href: "/favicon-v3.ico",
- sizes: "32x32",
- },
- },
- {
- tag: "link",
- attrs: {
- rel: "icon",
- type: "image/png",
- href: "/favicon-96x96-v3.png",
- sizes: "96x96",
- },
- },
- {
- tag: "link",
- attrs: {
- rel: "apple-touch-icon",
- href: "/apple-touch-icon-v3.png",
- sizes: "180x180",
- },
- },
- ],
- lastUpdated: true,
- expressiveCode: { themes: ["github-light", "github-dark"] },
- social: [
- { icon: "github", label: "GitHub", href: config.github },
- { icon: "discord", label: "Discord", href: config.discord },
- ],
- editLink: {
- baseUrl: `${config.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: [
- "",
- "config",
- "providers",
- "network",
- "enterprise",
- "troubleshooting",
- "windows-wsl",
- "1-0",
- {
- label: "Usage",
- translations: {
- en: "Usage",
- ar: "الاستخدام",
- "bs-BA": "Korištenje",
- "da-DK": "Brug",
- "de-DE": "Nutzung",
- "es-ES": "Uso",
- "fr-FR": "Utilisation",
- "it-IT": "Utilizzo",
- "ja-JP": "使い方",
- "ko-KR": "사용",
- "nb-NO": "Bruk",
- "pl-PL": "Użycie",
- "pt-BR": "Uso",
- "ru-RU": "Использование",
- "th-TH": "การใช้งาน",
- "tr-TR": "Kullanım",
- "zh-CN": "使用",
- "zh-TW": "使用",
- },
- items: ["tui", "cli", "web", "ide", "zen", "share", "github", "gitlab"],
- },
- {
- label: "Configure",
- translations: {
- en: "Configure",
- ar: "الإعداد",
- "bs-BA": "Podešavanje",
- "da-DK": "Konfiguration",
- "de-DE": "Konfiguration",
- "es-ES": "Configuración",
- "fr-FR": "Configuration",
- "it-IT": "Configurazione",
- "ja-JP": "設定",
- "ko-KR": "구성",
- "nb-NO": "Konfigurasjon",
- "pl-PL": "Konfiguracja",
- "pt-BR": "Configuração",
- "ru-RU": "Настройка",
- "th-TH": "การกำหนดค่า",
- "tr-TR": "Yapılandırma",
- "zh-CN": "配置",
- "zh-TW": "設定",
- },
- items: [
- "tools",
- "rules",
- "agents",
- "models",
- "themes",
- "keybinds",
- "commands",
- "formatters",
- "permissions",
- "lsp",
- "mcp-servers",
- "acp",
- "skills",
- "custom-tools",
- ],
- },
- {
- label: "Develop",
- translations: {
- en: "Develop",
- ar: "التطوير",
- "bs-BA": "Razvoj",
- "da-DK": "Udvikling",
- "de-DE": "Entwicklung",
- "es-ES": "Desarrollo",
- "fr-FR": "Développement",
- "it-IT": "Sviluppo",
- "ja-JP": "開発",
- "ko-KR": "개발",
- "nb-NO": "Utvikling",
- "pl-PL": "Rozwój",
- "pt-BR": "Desenvolvimento",
- "ru-RU": "Разработка",
- "th-TH": "การพัฒนา",
- "tr-TR": "Geliştirme",
- "zh-CN": "开发",
- "zh-TW": "開發",
- },
- items: ["sdk", "server", "plugins", "ecosystem"],
- },
- ],
- components: {
- Hero: "./src/components/Hero.astro",
- Head: "./src/components/Head.astro",
- Header: "./src/components/Header.astro",
- Footer: "./src/components/Footer.astro",
- SiteTitle: "./src/components/SiteTitle.astro",
- },
- plugins: [
- theme({
- headerLinks: config.headerLinks,
- }),
- ],
- }),
- ],
- })
- function configSchema() {
- return {
- name: "configSchema",
- hooks: {
- "astro:build:done": async () => {
- console.log("generating config schema")
- spawnSync("../opencode/script/schema.ts", ["./dist/config.json"])
- },
- },
- }
- }
|