docusaurus.config.ts 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  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. "posthog-docusaurus",
  79. {
  80. apiKey: process.env.POSTHOG_API_KEY,
  81. appUrl: "https://us.i.posthog.com",
  82. enableInDevelopment: true,
  83. },
  84. ],
  85. ] : []),
  86. [
  87. '@docusaurus/plugin-client-redirects',
  88. {
  89. redirects: [
  90. // Files moved from advanced-usage to features
  91. {
  92. to: '/features/checkpoints',
  93. from: ['/advanced-usage/checkpoints'],
  94. },
  95. {
  96. to: '/features/code-actions',
  97. from: ['/advanced-usage/code-actions'],
  98. },
  99. {
  100. to: '/advanced-usage/custom-instructions',
  101. from: ['/features/custom-instructions'],
  102. },
  103. {
  104. to: '/features/custom-modes',
  105. from: ['/advanced-usage/custom-modes'],
  106. },
  107. {
  108. to: '/features/enhance-prompt',
  109. from: ['/advanced-usage/enhance-prompt'],
  110. },
  111. {
  112. to: '/features/experimental/experimental-features',
  113. from: ['/advanced-usage/experimental-features'],
  114. },
  115. {
  116. to: '/features/model-temperature',
  117. from: ['/advanced-usage/model-temperature'],
  118. },
  119. {
  120. to: '/features/auto-approving-actions',
  121. from: ['/advanced-usage/auto-approving-actions'],
  122. },
  123. {
  124. to: '/features/api-configuration-profiles',
  125. from: ['/advanced-usage/api-configuration-profiles'],
  126. },
  127. // MCP related redirects
  128. {
  129. to: '/features/mcp/overview',
  130. from: ['/advanced-usage/mcp', '/mcp/overview'],
  131. },
  132. {
  133. to: '/features/mcp/using-mcp-in-kilo-code',
  134. from: ['/mcp/using-mcp-in-kilo-code'],
  135. },
  136. {
  137. to: '/features/mcp/what-is-mcp',
  138. from: ['/mcp/what-is-mcp'],
  139. },
  140. {
  141. to: '/features/mcp/server-transports',
  142. from: ['/mcp/server-transports'],
  143. },
  144. {
  145. to: '/features/mcp/mcp-vs-api',
  146. from: ['/mcp/mcp-vs-api'],
  147. },
  148. ],
  149. },
  150. ],
  151. ],
  152. themeConfig: {
  153. image: 'img/kilo-v1.svg',
  154. navbar: {
  155. title: 'Kilo Code',
  156. logo: {
  157. alt: 'Kilo Code Logo',
  158. src: 'img/kilo-v1.svg',
  159. srcDark: 'img/kilo-v1-white.svg',
  160. href: '/',
  161. target: '_self'
  162. },
  163. items: [
  164. {
  165. href: GITHUB_MAIN_REPO_URL,
  166. label: 'GitHub',
  167. position: 'right',
  168. },
  169. {
  170. href: VSCODE_MARKETPLACE_URL,
  171. label: 'Install Extension',
  172. position: 'right',
  173. },
  174. {
  175. type: 'localeDropdown',
  176. position: 'right',
  177. },
  178. ],
  179. },
  180. footer: {
  181. style: 'dark',
  182. links: [
  183. {
  184. title: 'Community',
  185. items: [
  186. {
  187. label: 'Discord',
  188. href: DISCORD_URL,
  189. },
  190. {
  191. label: 'Reddit',
  192. href: REDDIT_URL,
  193. },
  194. {
  195. label: 'Twitter',
  196. href: TWITTER_URL,
  197. },
  198. ],
  199. },
  200. {
  201. title: 'GitHub',
  202. items: [
  203. {
  204. label: 'Issues',
  205. href: GITHUB_ISSUES_MAIN_URL,
  206. },
  207. {
  208. label: 'Feature Requests',
  209. href: GITHUB_FEATURES_URL,
  210. },
  211. ],
  212. },
  213. {
  214. title: 'Download',
  215. items: [
  216. {
  217. label: 'VS Code Marketplace',
  218. href: VSCODE_MARKETPLACE_URL,
  219. },
  220. {
  221. label: 'Open VSX Registry',
  222. href: OPEN_VSX_URL,
  223. },
  224. ],
  225. },
  226. {
  227. title: 'Company',
  228. items: [
  229. {
  230. label: 'Contact',
  231. href: CONTACT_EMAIL,
  232. target: '_self',
  233. },
  234. {
  235. label: 'Careers',
  236. href: CAREERS_URL,
  237. },
  238. {
  239. label: 'Website Privacy Policy',
  240. href: WEBSITE_PRIVACY_URL,
  241. },
  242. {
  243. label: 'Extension Privacy Policy',
  244. href: EXTENSION_PRIVACY_URL,
  245. },
  246. ],
  247. },
  248. ],
  249. },
  250. prism: {
  251. theme: prismThemes.github,
  252. darkTheme: prismThemes.dracula,
  253. },
  254. } satisfies Preset.ThemeConfig,
  255. };
  256. export default config;