docusaurus.config.ts 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  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. // Kilo credits, not tokens
  151. {
  152. to: "/basic-usage/adding-credits",
  153. from: ["/basic-usage/adding-tokens"],
  154. },
  155. // Change to plans language
  156. {
  157. to: "/plans/about",
  158. from: ["/seats/about"],
  159. },
  160. {
  161. to: "/plans/getting-started",
  162. from: ["/seats/getting-started"],
  163. },
  164. {
  165. to: "/plans/dashboard",
  166. from: ["/seats/dashboard"],
  167. },
  168. {
  169. to: "/plans/analytics",
  170. from: ["/seats/analytics"],
  171. },
  172. {
  173. to: "/plans/team-management",
  174. from: ["/seats/team-management"],
  175. },
  176. {
  177. to: "/plans/custom-modes",
  178. from: ["/seats/custom-modes"],
  179. },
  180. {
  181. to: "/plans/billing",
  182. from: ["/seats/billing"],
  183. },
  184. {
  185. to: "/plans/enterprise/SSO",
  186. from: ["/seats/enterprise/SSO"],
  187. },
  188. {
  189. to: "/plans/enterprise/model-access",
  190. from: ["/seats/enterprise/model-access"],
  191. },
  192. {
  193. to: "/plans/enterprise/audit-logs",
  194. from: ["/seats/enterprise/audit-logs"],
  195. },
  196. {
  197. to: "/plans/migration",
  198. from: ["/seats/migration"],
  199. },
  200. ],
  201. },
  202. ],
  203. ],
  204. themeConfig: {
  205. image: "img/kilo-v1.svg",
  206. navbar: {
  207. title: "Kilo Code",
  208. logo: {
  209. alt: "Kilo Code Logo",
  210. src: "img/kilo-v1.svg",
  211. srcDark: "img/kilo-v1-white.svg",
  212. href: "/",
  213. target: "_self",
  214. },
  215. items: [
  216. {
  217. href: GITHUB_MAIN_REPO_URL,
  218. label: "GitHub",
  219. position: "right",
  220. },
  221. {
  222. href: VSCODE_MARKETPLACE_URL,
  223. label: "Install Extension",
  224. position: "right",
  225. },
  226. {
  227. type: "localeDropdown",
  228. position: "right",
  229. },
  230. ],
  231. },
  232. footer: {
  233. style: "dark",
  234. links: [
  235. {
  236. title: "Community",
  237. items: [
  238. {
  239. label: "Discord",
  240. href: DISCORD_URL,
  241. },
  242. {
  243. label: "Reddit",
  244. href: REDDIT_URL,
  245. },
  246. {
  247. label: "Twitter",
  248. href: TWITTER_URL,
  249. },
  250. ],
  251. },
  252. {
  253. title: "GitHub",
  254. items: [
  255. {
  256. label: "Issues",
  257. href: GITHUB_ISSUES_MAIN_URL,
  258. },
  259. {
  260. label: "Feature Requests",
  261. href: GITHUB_FEATURES_URL,
  262. },
  263. ],
  264. },
  265. {
  266. title: "Download",
  267. items: [
  268. {
  269. label: "VS Code Marketplace",
  270. href: VSCODE_MARKETPLACE_URL,
  271. },
  272. {
  273. label: "Open VSX Registry",
  274. href: OPEN_VSX_URL,
  275. },
  276. ],
  277. },
  278. {
  279. title: "Company",
  280. items: [
  281. {
  282. label: "Contact",
  283. href: CONTACT_EMAIL,
  284. target: "_self",
  285. },
  286. {
  287. label: "Careers",
  288. href: CAREERS_URL,
  289. },
  290. {
  291. label: "Website Privacy Policy",
  292. href: WEBSITE_PRIVACY_URL,
  293. },
  294. {
  295. label: "Extension Privacy Policy",
  296. href: EXTENSION_PRIVACY_URL,
  297. },
  298. ],
  299. },
  300. ],
  301. },
  302. prism: {
  303. theme: prismThemes.github,
  304. darkTheme: prismThemes.dracula,
  305. },
  306. } satisfies Preset.ThemeConfig,
  307. }
  308. export default config