astro.config.mjs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. // https://astro.build/config
  12. export default defineConfig({
  13. site: config.url,
  14. output: "server",
  15. adapter: cloudflare({
  16. imageService: "passthrough",
  17. }),
  18. devToolbar: {
  19. enabled: false,
  20. },
  21. markdown: {
  22. rehypePlugins: [
  23. rehypeHeadingIds,
  24. [rehypeAutolinkHeadings, { behavior: "wrap" }],
  25. ],
  26. },
  27. integrations: [
  28. solidJs(),
  29. starlight({
  30. title: "opencode",
  31. expressiveCode: { themes: ["github-light", "github-dark"] },
  32. social: [{ icon: "github", label: "GitHub", href: config.github }],
  33. head: [
  34. {
  35. tag: "link",
  36. attrs: {
  37. rel: "icon",
  38. href: "/favicon.svg",
  39. },
  40. },
  41. ],
  42. editLink: {
  43. baseUrl: `${github}/edit/dev/packages/web/`,
  44. },
  45. markdown: {
  46. headingLinks: false,
  47. },
  48. customCss: ["./src/styles/custom.css"],
  49. logo: {
  50. light: "./src/assets/logo-light.svg",
  51. dark: "./src/assets/logo-dark.svg",
  52. replacesTitle: true,
  53. },
  54. sidebar: [
  55. "docs",
  56. "docs/cli",
  57. "docs/rules",
  58. "docs/config",
  59. "docs/models",
  60. "docs/themes",
  61. "docs/keybinds",
  62. "docs/mcp-servers",
  63. ],
  64. components: {
  65. Hero: "./src/components/Hero.astro",
  66. Head: "./src/components/Head.astro",
  67. Header: "./src/components/Header.astro",
  68. },
  69. plugins: [
  70. theme({
  71. headerLinks: config.headerLinks,
  72. }),
  73. ],
  74. }),
  75. ],
  76. })