astro.config.mjs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. // @ts-check
  2. import { defineConfig } from "astro/config"
  3. import starlight from "@astrojs/starlight"
  4. import solidJs from "@astrojs/solid-js"
  5. import cloudflare from "@astrojs/cloudflare"
  6. import theme from "toolbeam-docs-theme"
  7. import config from "./config.mjs"
  8. import { rehypeHeadingIds } from "@astrojs/markdown-remark"
  9. import rehypeAutolinkHeadings from "rehype-autolink-headings"
  10. const github = "https://github.com/sst/opencode"
  11. const stage = process.env.SST_STAGE || "dev"
  12. // https://astro.build/config
  13. export default defineConfig({
  14. site: stage === "production"
  15. ? `https://${config.domain}`
  16. : `https://${stage}.${config.domain}`,
  17. output: "server",
  18. adapter: cloudflare({
  19. imageService: "passthrough",
  20. }),
  21. devToolbar: {
  22. enabled: false,
  23. },
  24. server: {
  25. host: "0.0.0.0",
  26. },
  27. markdown: {
  28. rehypePlugins: [rehypeHeadingIds, [rehypeAutolinkHeadings, { behavior: "wrap" }]],
  29. },
  30. integrations: [
  31. solidJs(),
  32. starlight({
  33. title: "opencode",
  34. expressiveCode: { themes: ["github-light", "github-dark"] },
  35. social: [
  36. { icon: "github", label: "GitHub", href: config.github },
  37. { icon: "discord", label: "Dscord", href: config.discord },
  38. ],
  39. head: [
  40. {
  41. tag: "link",
  42. attrs: {
  43. rel: "icon",
  44. href: "/favicon.svg",
  45. },
  46. },
  47. ],
  48. editLink: {
  49. baseUrl: `${github}/edit/dev/packages/web/`,
  50. },
  51. markdown: {
  52. headingLinks: false,
  53. },
  54. customCss: ["./src/styles/custom.css"],
  55. logo: {
  56. light: "./src/assets/logo-light.svg",
  57. dark: "./src/assets/logo-dark.svg",
  58. replacesTitle: true,
  59. },
  60. sidebar: [
  61. "docs",
  62. "docs/cli",
  63. "docs/rules",
  64. "docs/config",
  65. "docs/models",
  66. "docs/themes",
  67. "docs/keybinds",
  68. "docs/mcp-servers",
  69. ],
  70. components: {
  71. Hero: "./src/components/Hero.astro",
  72. Head: "./src/components/Head.astro",
  73. Header: "./src/components/Header.astro",
  74. },
  75. plugins: [
  76. theme({
  77. headerLinks: config.headerLinks,
  78. }),
  79. ],
  80. }),
  81. ],
  82. })