docusaurus.config.ts 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370
  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://kilo.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_MAIN_REPO_URL}/edit/main/apps/kilocode-docs/`,
  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. createRedirects(existingPath) {
  92. // Redirect old /contributing/specs/spec-* paths to /contributing/architecture/*
  93. if (existingPath.startsWith("/contributing/architecture/")) {
  94. const filename = existingPath.replace("/contributing/architecture/", "")
  95. return [
  96. `/contributing/specs/spec-${filename}`, // spec- prefix
  97. `/contributing/specs/${filename}`, // without prefix
  98. ]
  99. }
  100. return undefined
  101. },
  102. redirects: [
  103. // Files moved from advanced-usage to features
  104. {
  105. to: "/features/checkpoints",
  106. from: ["/advanced-usage/checkpoints"],
  107. },
  108. {
  109. to: "/features/code-actions",
  110. from: ["/advanced-usage/code-actions"],
  111. },
  112. {
  113. to: "/agent-behavior/custom-instructions",
  114. from: [
  115. "/advanced-usage/custom-instructions",
  116. "/features/custom-instructions",
  117. "/customization/custom-instructions",
  118. ],
  119. },
  120. {
  121. to: "/agent-behavior/custom-modes",
  122. from: ["/features/custom-modes", "/advanced-usage/custom-modes", "/customization/custom-modes"],
  123. },
  124. {
  125. to: "/agent-behavior/custom-rules",
  126. from: ["/advanced-usage/custom-rules", "/customization/custom-rules"],
  127. },
  128. {
  129. to: "/agent-behavior/skills",
  130. from: ["/features/skills", "/customization/skills"],
  131. },
  132. {
  133. to: "/agent-behavior/workflows",
  134. from: ["/features/slash-commands/workflows", "/customization/workflows"],
  135. },
  136. {
  137. to: "/basic-usage/settings-management",
  138. from: ["/features/settings-management", "/customization/settings-management"],
  139. },
  140. {
  141. to: "/agent-behavior/prompt-engineering",
  142. from: ["/advanced-usage/prompt-engineering"],
  143. },
  144. {
  145. to: "/features/enhance-prompt",
  146. from: ["/advanced-usage/enhance-prompt"],
  147. },
  148. {
  149. to: "/features/experimental/experimental-features",
  150. from: ["/advanced-usage/experimental-features"],
  151. },
  152. {
  153. to: "/features/model-temperature",
  154. from: ["/advanced-usage/model-temperature"],
  155. },
  156. {
  157. to: "/features/auto-approving-actions",
  158. from: ["/advanced-usage/auto-approving-actions"],
  159. },
  160. {
  161. to: "/features/api-configuration-profiles",
  162. from: ["/advanced-usage/api-configuration-profiles"],
  163. },
  164. {
  165. to: "/slack",
  166. from: ["/advanced-usage/slackbot"],
  167. },
  168. // MCP related redirects
  169. {
  170. to: "/features/mcp/overview",
  171. from: ["/advanced-usage/mcp", "/mcp/overview"],
  172. },
  173. {
  174. to: "/features/mcp/using-mcp-in-kilo-code",
  175. from: ["/mcp/using-mcp-in-kilo-code"],
  176. },
  177. {
  178. to: "/features/mcp/what-is-mcp",
  179. from: ["/mcp/what-is-mcp"],
  180. },
  181. {
  182. to: "/features/mcp/server-transports",
  183. from: ["/mcp/server-transports"],
  184. },
  185. {
  186. to: "/features/mcp/mcp-vs-api",
  187. from: ["/mcp/mcp-vs-api"],
  188. },
  189. // Kilo credits, not tokens
  190. {
  191. to: "/basic-usage/adding-credits",
  192. from: ["/basic-usage/adding-tokens"],
  193. },
  194. // Change to plans language
  195. {
  196. to: "/plans/about",
  197. from: ["/seats/about"],
  198. },
  199. {
  200. to: "/plans/getting-started",
  201. from: ["/seats/getting-started"],
  202. },
  203. {
  204. to: "/plans/dashboard",
  205. from: ["/seats/dashboard"],
  206. },
  207. {
  208. to: "/plans/analytics",
  209. from: ["/seats/analytics"],
  210. },
  211. {
  212. to: "/plans/team-management",
  213. from: ["/seats/team-management"],
  214. },
  215. {
  216. to: "/plans/custom-modes",
  217. from: ["/seats/custom-modes"],
  218. },
  219. {
  220. to: "/plans/billing",
  221. from: ["/seats/billing"],
  222. },
  223. {
  224. to: "/plans/enterprise/SSO",
  225. from: ["/seats/enterprise/SSO"],
  226. },
  227. {
  228. to: "/plans/enterprise/model-access",
  229. from: ["/seats/enterprise/model-access"],
  230. },
  231. {
  232. to: "/plans/enterprise/audit-logs",
  233. from: ["/seats/enterprise/audit-logs"],
  234. },
  235. {
  236. to: "/plans/migration",
  237. from: ["/seats/migration"],
  238. },
  239. // Contributing page relocation
  240. {
  241. to: "/contributing",
  242. from: ["/extending/contributing-to-kilo"],
  243. },
  244. {
  245. to: "/contributing/development-environment",
  246. from: ["/extending/development-environment"],
  247. },
  248. ],
  249. },
  250. ],
  251. ],
  252. themeConfig: {
  253. image: "img/kilo-v1.svg",
  254. navbar: {
  255. title: "Kilo Code",
  256. logo: {
  257. alt: "Kilo Code Logo",
  258. src: "img/kilo-v1.svg",
  259. srcDark: "img/kilo-v1-white.svg",
  260. href: "/",
  261. target: "_self",
  262. },
  263. items: [
  264. {
  265. href: GITHUB_MAIN_REPO_URL,
  266. label: "GitHub",
  267. position: "right",
  268. },
  269. {
  270. href: VSCODE_MARKETPLACE_URL,
  271. label: "Install Extension",
  272. position: "right",
  273. },
  274. {
  275. type: "localeDropdown",
  276. position: "right",
  277. },
  278. ],
  279. },
  280. footer: {
  281. style: "dark",
  282. links: [
  283. {
  284. title: "Community",
  285. items: [
  286. {
  287. label: "Discord",
  288. href: DISCORD_URL,
  289. },
  290. {
  291. label: "Reddit",
  292. href: REDDIT_URL,
  293. },
  294. {
  295. label: "Twitter",
  296. href: TWITTER_URL,
  297. },
  298. ],
  299. },
  300. {
  301. title: "GitHub",
  302. items: [
  303. {
  304. label: "Issues",
  305. href: GITHUB_ISSUES_MAIN_URL,
  306. },
  307. {
  308. label: "Feature Requests",
  309. href: GITHUB_FEATURES_URL,
  310. },
  311. ],
  312. },
  313. {
  314. title: "Download",
  315. items: [
  316. {
  317. label: "VS Code Marketplace",
  318. href: VSCODE_MARKETPLACE_URL,
  319. },
  320. {
  321. label: "Open VSX Registry",
  322. href: OPEN_VSX_URL,
  323. },
  324. ],
  325. },
  326. {
  327. title: "Company",
  328. items: [
  329. {
  330. label: "Contact",
  331. href: CONTACT_EMAIL,
  332. target: "_self",
  333. },
  334. {
  335. label: "Careers",
  336. href: CAREERS_URL,
  337. },
  338. {
  339. label: "Website Privacy Policy",
  340. href: WEBSITE_PRIVACY_URL,
  341. },
  342. {
  343. label: "Extension Privacy Policy",
  344. href: EXTENSION_PRIVACY_URL,
  345. },
  346. ],
  347. },
  348. ],
  349. },
  350. prism: {
  351. theme: prismThemes.github,
  352. darkTheme: prismThemes.dracula,
  353. },
  354. } satisfies Preset.ThemeConfig,
  355. }
  356. export default config