astro.config.mjs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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: [
  33. { icon: "github", label: "GitHub", href: config.github },
  34. { icon: "discord", label: "Dscord", href: config.discord }
  35. ],
  36. head: [
  37. {
  38. tag: "link",
  39. attrs: {
  40. rel: "icon",
  41. href: "/favicon.svg",
  42. },
  43. },
  44. ],
  45. editLink: {
  46. baseUrl: `${github}/edit/dev/packages/web/`,
  47. },
  48. markdown: {
  49. headingLinks: false,
  50. },
  51. customCss: ["./src/styles/custom.css"],
  52. logo: {
  53. light: "./src/assets/logo-light.svg",
  54. dark: "./src/assets/logo-dark.svg",
  55. replacesTitle: true,
  56. },
  57. sidebar: [
  58. "docs",
  59. "docs/cli",
  60. "docs/rules",
  61. "docs/config",
  62. "docs/models",
  63. "docs/themes",
  64. "docs/keybinds",
  65. "docs/mcp-servers",
  66. ],
  67. components: {
  68. Hero: "./src/components/Hero.astro",
  69. Head: "./src/components/Head.astro",
  70. Header: "./src/components/Header.astro",
  71. },
  72. plugins: [
  73. theme({
  74. headerLinks: config.headerLinks,
  75. }),
  76. ],
  77. }),
  78. ],
  79. })