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