docusaurus.config.js 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. // @ts-check
  2. // Note: type annotations allow type checking and IDEs autocompletion
  3. const lightCodeTheme = require("prism-react-renderer/themes/github");
  4. const darkCodeTheme = require("prism-react-renderer/themes/dracula");
  5. /** @type {import('@docusaurus/types').Config} */
  6. const config = {
  7. title: "QMK Firmware",
  8. tagline: "The full documentation of the open-source firmware",
  9. favicon: "img/favicon.ico",
  10. url: "https://docs.qmk.fm",
  11. baseUrl: "/",
  12. organizationName: "qmk",
  13. projectName: "qmk_firmware",
  14. deploymentBranch: "gh-pages",
  15. onBrokenLinks: "warn",
  16. onBrokenMarkdownLinks: "warn",
  17. i18n: {
  18. defaultLocale: "en",
  19. locales: ["en"], //, 'ja', 'zh-cn'],
  20. },
  21. themes: [
  22. [
  23. "classic",
  24. {
  25. customCss: require.resolve("./src/css/custom.css"),
  26. }
  27. ],
  28. [
  29. require.resolve("@easyops-cn/docusaurus-search-local"),
  30. {
  31. indexBlog: false,
  32. docsRouteBasePath: '/',
  33. searchResultLimits: 12,
  34. searchBarShortcut: false,
  35. },
  36. ],
  37. ],
  38. plugins: [
  39. [
  40. "@docusaurus/plugin-content-docs",
  41. {
  42. sidebarPath: require.resolve("./sidebars.js"),
  43. path: "../../docs",
  44. routeBasePath: "/",
  45. exclude: [
  46. "node_modules",
  47. "src",
  48. "static",
  49. "ja",
  50. "zh-cn",
  51. "gitbook",
  52. // "ChangeLog"
  53. ],
  54. editUrl:
  55. "https://github.com/qmk/qmk_firmware/edit/master/docs/",
  56. },
  57. ],
  58. [
  59. "@docusaurus/plugin-client-redirects",
  60. {
  61. // fromExtensions: ['md', 'html'],
  62. redirects: [
  63. // from index.html
  64. {
  65. from: '/adding_a_keyboard_to_qmk',
  66. to: '/hardware_keyboard_guidelines',
  67. },
  68. {
  69. from: '/build_environment_setup',
  70. to: '/newbs_getting_started',
  71. },
  72. {
  73. from: '/cli_dev_configuration',
  74. to: '/cli_configuration',
  75. },
  76. {
  77. from: '/dynamic_macros',
  78. to: '/feature_dynamic_macros',
  79. },
  80. {
  81. from: '/feature_common_shortcuts',
  82. to: '/feature_advanced_keycodes',
  83. },
  84. {
  85. from: '/glossary',
  86. to: '/reference_glossary',
  87. },
  88. {
  89. from: '/key_lock',
  90. to: '/feature_key_lock',
  91. },
  92. {
  93. from: '/make_instructions',
  94. to: '/getting_started_make_guide',
  95. },
  96. {
  97. from: ['/space_cadet_shift', '/feature_space_cadet_shift'],
  98. to: '/feature_space_cadet',
  99. },
  100. {
  101. from: '/getting_started_getting_help',
  102. to: '/support',
  103. },
  104. {
  105. from: '/tap_dance',
  106. to: '/feature_tap_dance',
  107. },
  108. {
  109. from: '/unicode',
  110. to: '/feature_unicode',
  111. },
  112. {
  113. from: '/python_development',
  114. to: '/cli_development',
  115. },
  116. {
  117. from: '/getting_started_build_tools',
  118. to: '/newbs_getting_started',
  119. },
  120. {
  121. from: '/tutorial',
  122. to: '/newbs',
  123. },
  124. // from redirects.json
  125. // {
  126. // from: "/adding_a_keyboard_to_qmk",
  127. // to: "/hardware_keyboard_guidelines"
  128. // },
  129. // {
  130. // from: "/build_environment_setup",
  131. // to: "/getting_started_build_tools"
  132. // },
  133. // {
  134. // from: "/dynamic_macros",
  135. // to: "/feature_dynamic_macros"
  136. // },
  137. // {
  138. // from: "/feature_common_shortcuts",
  139. // to: "/feature_advanced_keycodes"
  140. // },
  141. // {
  142. // from: "/glossary",
  143. // to: "/reference_glossary"
  144. // },
  145. // {
  146. // from: "/key_lock",
  147. // to: "/feature_key_lock"
  148. // },
  149. // {
  150. // from: "/make_instructions",
  151. // to: "/getting_started_make_guide"
  152. // },
  153. // {
  154. // from: "/porting_your_keyboard_to_qmk",
  155. // to: "/hardware_avr"
  156. // },
  157. // {
  158. // from: "/space_cadet_shift",
  159. // to: "/feature_space_cadet_shift"
  160. // },
  161. // {
  162. // from: "/tap_dance",
  163. // to: "/feature_tap_dance"
  164. // },
  165. // {
  166. // from: "/unicode",
  167. // to: "/feature_unicode"
  168. // },
  169. // {
  170. // from: "/python_development",
  171. // to: "/cli_development"
  172. // }
  173. ],
  174. },
  175. ],
  176. ],
  177. themeConfig:
  178. /** @type {import('@docusaurus/preset-classic').ThemeConfig} */
  179. ({
  180. image: "img/qmk-social-card.jpg",
  181. navbar: {
  182. title: "QMK Firmware Docs",
  183. logo: {
  184. alt: "QMK Firmware",
  185. src: "img/qmk-new-light.svg",
  186. srcDark: "img/qmk-new-dark.svg",
  187. width: 32,
  188. height: 32,
  189. },
  190. items: [
  191. // {
  192. // type: 'localeDropdown',
  193. // position: 'right',
  194. // },
  195. {
  196. href: "https://github.com/qmk/qmk_firmware",
  197. label: "GitHub",
  198. position: "right",
  199. },
  200. ],
  201. },
  202. docs: {
  203. sidebar: {
  204. autoCollapseCategories: false,
  205. },
  206. },
  207. footer: {
  208. style: "dark",
  209. links: [
  210. {
  211. title: "Docs",
  212. items: [
  213. {
  214. label: "Docs",
  215. to: "/",
  216. },
  217. ],
  218. },
  219. {
  220. title: "Community",
  221. items: [
  222. {
  223. label: "Discord",
  224. href: "https://discord.gg/Uq7gcHh",
  225. },
  226. {
  227. label: "Reddit",
  228. href: "https://reddit.com/r/olkb",
  229. },
  230. ],
  231. },
  232. {
  233. title: "More",
  234. items: [
  235. {
  236. label: "GitHub",
  237. href: "https://github.com/qmk/qmk_firmware",
  238. },
  239. ],
  240. },
  241. ],
  242. copyright: `Copyright © ${new Date().getFullYear()} QMK. Built with Docusaurus.`,
  243. },
  244. prism: {
  245. theme: lightCodeTheme,
  246. darkTheme: darkCodeTheme,
  247. },
  248. // applied for - will fill out once we hear back
  249. //
  250. // algolia: {
  251. // // The application ID provided by Algolia
  252. // appId: 'YOUR_APP_ID',
  253. // // Public API key: it is safe to commit it
  254. // apiKey: 'YOUR_SEARCH_API_KEY',
  255. // indexName: 'YOUR_INDEX_NAME',
  256. // // Optional: see doc section below
  257. // contextualSearch: true,
  258. // // Optional: Specify domains where the navigation should occur through window.location instead on history.push. Useful when our Algolia config crawls multiple documentation sites and we want to navigate with window.location.href to them.
  259. // externalUrlRegex: 'external\\.com|domain\\.com',
  260. // // Optional: Replace parts of the item URLs from Algolia. Useful when using the same search index for multiple deployments using a different baseUrl. You can use regexp or string in the `from` param. For example: localhost:3000 vs myCompany.com/docs
  261. // replaceSearchResultPathname: {
  262. // from: '/docs/', // or as RegExp: /\/docs\//
  263. // to: '/',
  264. // },
  265. // // Optional: Algolia search parameters
  266. // searchParameters: {},
  267. // // Optional: path for search page that enabled by default (`false` to disable it)
  268. // searchPagePath: 'search',
  269. // //... other Algolia params
  270. // },
  271. }),
  272. };
  273. module.exports = config;