astro.config.mjs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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: [
  36. { icon: "github", label: "GitHub", href: config.github },
  37. ],
  38. editLink: {
  39. baseUrl: `${github}/edit/master/www/`,
  40. },
  41. markdown: {
  42. headingLinks: false,
  43. },
  44. customCss: ["./src/styles/custom.css"],
  45. logo: {
  46. light: "./src/assets/logo-light.svg",
  47. dark: "./src/assets/logo-dark.svg",
  48. replacesTitle: true,
  49. },
  50. sidebar: [
  51. "docs",
  52. "docs/cli",
  53. "docs/config",
  54. "docs/models",
  55. "docs/themes",
  56. "docs/keybinds",
  57. "docs/mcp-servers",
  58. ],
  59. components: {
  60. Hero: "./src/components/Hero.astro",
  61. Header: "./src/components/Header.astro",
  62. },
  63. plugins: [
  64. theme({
  65. headerLinks: config.headerLinks,
  66. }),
  67. ],
  68. }),
  69. ],
  70. })