docusaurus.config.ts 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. import { themes as prismThemes } from "prism-react-renderer"
  2. import type { Config } from "@docusaurus/types"
  3. import type * as Preset from "@docusaurus/preset-classic"
  4. import {
  5. DISCORD_URL,
  6. REDDIT_URL,
  7. TWITTER_URL,
  8. GITHUB_MAIN_REPO_URL,
  9. GITHUB_ISSUES_MAIN_URL,
  10. GITHUB_FEATURES_URL,
  11. VSCODE_MARKETPLACE_URL,
  12. OPEN_VSX_URL,
  13. CONTACT_EMAIL,
  14. CAREERS_URL,
  15. WEBSITE_PRIVACY_URL,
  16. EXTENSION_PRIVACY_URL,
  17. GITHUB_REPO_URL,
  18. } from "./src/constants"
  19. // This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)
  20. const config: Config = {
  21. title: "Kilo Code Docs",
  22. tagline: "Kilo Code Documentation",
  23. favicon: "img/favicon.ico",
  24. // Set the production url of your site here
  25. url: "https://kilocode.ai",
  26. // Set the /<baseUrl>/ pathname under which your site is served
  27. // For GitHub pages deployment, it is often '/<projectName>/'
  28. baseUrl: "/docs",
  29. customFields: {
  30. freeTierAmount: process.env.FREE_TIER_AMOUNT || "$20",
  31. },
  32. onBrokenLinks: "throw",
  33. onBrokenMarkdownLinks: "warn",
  34. // Even if you don't use internationalization, you can use this field to set
  35. // useful metadata like html lang. For example, if your site is Chinese, you
  36. // may want to replace "en" with "zh-Hans".
  37. i18n: {
  38. defaultLocale: "en",
  39. locales: ["en", "zh-CN"],
  40. },
  41. presets: [
  42. [
  43. "classic",
  44. {
  45. docs: {
  46. sidebarPath: "./sidebars.ts",
  47. routeBasePath: "/",
  48. editUrl: `${GITHUB_REPO_URL}/edit/main/`,
  49. showLastUpdateTime: true,
  50. },
  51. blog: false, // Disable blog feature
  52. sitemap: {
  53. lastmod: "date",
  54. priority: null,
  55. changefreq: null,
  56. },
  57. theme: {
  58. customCss: "./src/css/custom.css",
  59. },
  60. } satisfies Preset.Options,
  61. ],
  62. ],
  63. themes: [
  64. [
  65. require.resolve("@easyops-cn/docusaurus-search-local"),
  66. {
  67. hashed: true,
  68. language: ["en"],
  69. highlightSearchTermsOnTargetPage: false,
  70. explicitSearchResultPath: true,
  71. docsRouteBasePath: "/",
  72. },
  73. ],
  74. ],
  75. plugins: [
  76. ...(process.env.POSTHOG_API_KEY
  77. ? [
  78. [
  79. "posthog-docusaurus",
  80. {
  81. apiKey: process.env.POSTHOG_API_KEY,
  82. appUrl: "https://us.i.posthog.com",
  83. enableInDevelopment: true,
  84. },
  85. ],
  86. ]
  87. : []),
  88. [
  89. "@docusaurus/plugin-client-redirects",
  90. {
  91. redirects: [
  92. // Files moved from advanced-usage to features
  93. {
  94. to: "/features/checkpoints",
  95. from: ["/advanced-usage/checkpoints"],
  96. },
  97. {
  98. to: "/features/code-actions",
  99. from: ["/advanced-usage/code-actions"],
  100. },
  101. {
  102. to: "/advanced-usage/custom-instructions",
  103. from: ["/features/custom-instructions"],
  104. },
  105. {
  106. to: "/features/custom-modes",
  107. from: ["/advanced-usage/custom-modes"],
  108. },
  109. {
  110. to: "/features/enhance-prompt",
  111. from: ["/advanced-usage/enhance-prompt"],
  112. },
  113. {
  114. to: "/features/experimental/experimental-features",
  115. from: ["/advanced-usage/experimental-features"],
  116. },
  117. {
  118. to: "/features/model-temperature",
  119. from: ["/advanced-usage/model-temperature"],
  120. },
  121. {
  122. to: "/features/auto-approving-actions",
  123. from: ["/advanced-usage/auto-approving-actions"],
  124. },
  125. {
  126. to: "/features/api-configuration-profiles",
  127. from: ["/advanced-usage/api-configuration-profiles"],
  128. },
  129. // MCP related redirects
  130. {
  131. to: "/features/mcp/overview",
  132. from: ["/advanced-usage/mcp", "/mcp/overview"],
  133. },
  134. {
  135. to: "/features/mcp/using-mcp-in-kilo-code",
  136. from: ["/mcp/using-mcp-in-kilo-code"],
  137. },
  138. {
  139. to: "/features/mcp/what-is-mcp",
  140. from: ["/mcp/what-is-mcp"],
  141. },
  142. {
  143. to: "/features/mcp/server-transports",
  144. from: ["/mcp/server-transports"],
  145. },
  146. {
  147. to: "/features/mcp/mcp-vs-api",
  148. from: ["/mcp/mcp-vs-api"],
  149. },
  150. // Deleted seats page
  151. {
  152. to: "/seats/team-management",
  153. from: ["/seats/team-management"],
  154. },
  155. // Kilo credits, not tokens
  156. {
  157. to: "/basic-usage/adding-credits",
  158. from: ["/basic-usage/adding-tokens"],
  159. },
  160. ],
  161. },
  162. ],
  163. ],
  164. themeConfig: {
  165. image: "img/kilo-v1.svg",
  166. navbar: {
  167. title: "Kilo Code",
  168. logo: {
  169. alt: "Kilo Code Logo",
  170. src: "img/kilo-v1.svg",
  171. srcDark: "img/kilo-v1-white.svg",
  172. href: "/",
  173. target: "_self",
  174. },
  175. items: [
  176. {
  177. href: GITHUB_MAIN_REPO_URL,
  178. label: "GitHub",
  179. position: "right",
  180. },
  181. {
  182. href: VSCODE_MARKETPLACE_URL,
  183. label: "Install Extension",
  184. position: "right",
  185. },
  186. {
  187. type: "localeDropdown",
  188. position: "right",
  189. },
  190. ],
  191. },
  192. footer: {
  193. style: "dark",
  194. links: [
  195. {
  196. title: "Community",
  197. items: [
  198. {
  199. label: "Discord",
  200. href: DISCORD_URL,
  201. },
  202. {
  203. label: "Reddit",
  204. href: REDDIT_URL,
  205. },
  206. {
  207. label: "Twitter",
  208. href: TWITTER_URL,
  209. },
  210. ],
  211. },
  212. {
  213. title: "GitHub",
  214. items: [
  215. {
  216. label: "Issues",
  217. href: GITHUB_ISSUES_MAIN_URL,
  218. },
  219. {
  220. label: "Feature Requests",
  221. href: GITHUB_FEATURES_URL,
  222. },
  223. ],
  224. },
  225. {
  226. title: "Download",
  227. items: [
  228. {
  229. label: "VS Code Marketplace",
  230. href: VSCODE_MARKETPLACE_URL,
  231. },
  232. {
  233. label: "Open VSX Registry",
  234. href: OPEN_VSX_URL,
  235. },
  236. ],
  237. },
  238. {
  239. title: "Company",
  240. items: [
  241. {
  242. label: "Contact",
  243. href: CONTACT_EMAIL,
  244. target: "_self",
  245. },
  246. {
  247. label: "Careers",
  248. href: CAREERS_URL,
  249. },
  250. {
  251. label: "Website Privacy Policy",
  252. href: WEBSITE_PRIVACY_URL,
  253. },
  254. {
  255. label: "Extension Privacy Policy",
  256. href: EXTENSION_PRIVACY_URL,
  257. },
  258. ],
  259. },
  260. ],
  261. },
  262. prism: {
  263. theme: prismThemes.github,
  264. darkTheme: prismThemes.dracula,
  265. },
  266. } satisfies Preset.ThemeConfig,
  267. }
  268. export default config