astro.config.mjs 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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 url = "https://opencode.ai"
  11. const github = "https://github.com/sst/opencode"
  12. // https://astro.build/config
  13. export default defineConfig({
  14. site: url,
  15. output: "server",
  16. adapter: cloudflare({
  17. imageService: "passthrough",
  18. }),
  19. devToolbar: {
  20. enabled: false,
  21. },
  22. markdown: {
  23. rehypePlugins: [
  24. rehypeHeadingIds,
  25. [rehypeAutolinkHeadings, { behavior: "wrap" }],
  26. ],
  27. },
  28. integrations: [
  29. solidJs(),
  30. starlight({
  31. title: "opencode",
  32. expressiveCode: { themes: ["github-light", "github-dark"] },
  33. social: [
  34. { icon: "github", label: "GitHub", href: config.github },
  35. ],
  36. head: [
  37. {
  38. tag: "link",
  39. attrs: {
  40. rel: "icon",
  41. href: "/favicon.svg",
  42. },
  43. },
  44. {
  45. tag: "meta",
  46. attrs: {
  47. property: "og:image",
  48. content: `${url}/social-share.png`,
  49. },
  50. },
  51. {
  52. tag: "meta",
  53. attrs: {
  54. property: "twitter:image",
  55. content: `${url}/social-share.png`,
  56. },
  57. },
  58. ],
  59. editLink: {
  60. baseUrl: `${github}/edit/master/www/`,
  61. },
  62. markdown: {
  63. headingLinks: false,
  64. },
  65. customCss: ["./src/styles/custom.css"],
  66. logo: {
  67. light: "./src/assets/logo-light.svg",
  68. dark: "./src/assets/logo-dark.svg",
  69. replacesTitle: true,
  70. },
  71. sidebar: [
  72. "docs",
  73. "docs/cli",
  74. "docs/config",
  75. "docs/agents",
  76. "docs/models",
  77. "docs/themes",
  78. "docs/keybinds",
  79. "docs/mcp-servers",
  80. ],
  81. components: {
  82. Hero: "./src/components/Hero.astro",
  83. Header: "./src/components/Header.astro",
  84. },
  85. plugins: [
  86. theme({
  87. headerLinks: config.headerLinks,
  88. }),
  89. ],
  90. }),
  91. ],
  92. })