astro.config.mjs 1.9 KB

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