astro.config.mjs 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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: [{ icon: "github", label: "GitHub", href: config.github }],
  34. head: [
  35. {
  36. tag: "link",
  37. attrs: {
  38. rel: "icon",
  39. href: "/favicon.svg",
  40. },
  41. },
  42. {
  43. tag: "meta",
  44. attrs: {
  45. property: "og:image",
  46. content: `${url}/social-share.png`,
  47. },
  48. },
  49. {
  50. tag: "meta",
  51. attrs: {
  52. property: "twitter:image",
  53. content: `${url}/social-share.png`,
  54. },
  55. },
  56. ],
  57. editLink: {
  58. baseUrl: `${github}/edit/master/www/`,
  59. },
  60. markdown: {
  61. headingLinks: false,
  62. },
  63. customCss: ["./src/styles/custom.css"],
  64. logo: {
  65. light: "./src/assets/logo-light.svg",
  66. dark: "./src/assets/logo-dark.svg",
  67. replacesTitle: true,
  68. },
  69. sidebar: [
  70. "docs",
  71. "docs/cli",
  72. "docs/rules",
  73. "docs/config",
  74. "docs/models",
  75. "docs/themes",
  76. "docs/keybinds",
  77. "docs/mcp-servers",
  78. ],
  79. components: {
  80. Hero: "./src/components/Hero.astro",
  81. Header: "./src/components/Header.astro",
  82. },
  83. plugins: [
  84. theme({
  85. headerLinks: config.headerLinks,
  86. }),
  87. ],
  88. }),
  89. ],
  90. })