astro.config.mjs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. // @ts-check
  2. import { defineConfig } from "astro/config"
  3. import starlight from "@astrojs/starlight"
  4. import solidJs from "@astrojs/solid-js"
  5. import theme from "toolbeam-docs-theme"
  6. import { rehypeHeadingIds } from "@astrojs/markdown-remark"
  7. import rehypeAutolinkHeadings from "rehype-autolink-headings"
  8. const discord = "https://discord.gg/sst"
  9. const github = "https://github.com/sst/opencode"
  10. // https://astro.build/config
  11. export default defineConfig({
  12. devToolbar: {
  13. enabled: false,
  14. },
  15. markdown: {
  16. rehypePlugins: [
  17. rehypeHeadingIds,
  18. [rehypeAutolinkHeadings, { behavior: "wrap" }],
  19. ],
  20. },
  21. integrations: [
  22. solidJs(),
  23. starlight({
  24. title: "OpenCode",
  25. expressiveCode: { themes: ["github-light", "github-dark"] },
  26. social: [
  27. { icon: "discord", label: "Discord", href: discord },
  28. { icon: "github", label: "GitHub", href: github },
  29. ],
  30. editLink: {
  31. baseUrl: `${github}/edit/master/www/`,
  32. },
  33. markdown: {
  34. headingLinks: false,
  35. },
  36. customCss: ["./src/styles/custom.css"],
  37. logo: {
  38. light: "./src/assets/logo-light.svg",
  39. dark: "./src/assets/logo-dark.svg",
  40. replacesTitle: true,
  41. },
  42. sidebar: [
  43. "docs",
  44. "docs/cli",
  45. "docs/config",
  46. "docs/models",
  47. "docs/themes",
  48. "docs/shortcuts",
  49. "docs/lsp-servers",
  50. "docs/mcp-servers",
  51. ],
  52. components: {
  53. Hero: "./src/components/Hero.astro",
  54. Header: "./src/components/Header.astro",
  55. },
  56. plugins: [
  57. theme({
  58. // Optionally, add your own header links
  59. headerLinks: [
  60. { name: "Home", url: "/" },
  61. { name: "Docs", url: "/docs/" },
  62. ],
  63. }),
  64. ],
  65. }),
  66. ],
  67. })