astro.config.mjs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 headerLinks = [
  12. { name: "Docs", url: "/docs/" },
  13. { name: "GitHub", url: github },
  14. ]
  15. // https://astro.build/config
  16. export default defineConfig({
  17. output: "server",
  18. adapter: cloudflare({
  19. imageService: "passthrough",
  20. }),
  21. devToolbar: {
  22. enabled: false,
  23. },
  24. markdown: {
  25. rehypePlugins: [
  26. rehypeHeadingIds,
  27. [rehypeAutolinkHeadings, { behavior: "wrap" }],
  28. ],
  29. },
  30. integrations: [
  31. solidJs(),
  32. starlight({
  33. title: "opencode",
  34. expressiveCode: { themes: ["github-light", "github-dark"] },
  35. social: [{ icon: "github", label: "GitHub", href: config.github }],
  36. editLink: {
  37. baseUrl: `${github}/edit/master/www/`,
  38. },
  39. markdown: {
  40. headingLinks: false,
  41. },
  42. customCss: ["./src/styles/custom.css"],
  43. logo: {
  44. light: "./src/assets/logo-light.svg",
  45. dark: "./src/assets/logo-dark.svg",
  46. replacesTitle: true,
  47. },
  48. sidebar: [
  49. "docs",
  50. "docs/cli",
  51. "docs/config",
  52. "docs/agents",
  53. "docs/models",
  54. "docs/themes",
  55. "docs/keybinds",
  56. "docs/mcp-servers",
  57. ],
  58. components: {
  59. Hero: "./src/components/Hero.astro",
  60. Header: "./src/components/Header.astro",
  61. },
  62. plugins: [
  63. theme({
  64. headerLinks: config.headerLinks,
  65. }),
  66. ],
  67. }),
  68. ],
  69. })