docusaurus.config.js 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  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. plugins: [
  30. [
  31. "@docusaurus/plugin-content-docs",
  32. {
  33. sidebarPath: require.resolve("./sidebars.js"),
  34. path: ".",
  35. routeBasePath: "/",
  36. exclude: [
  37. "node_modules",
  38. "src",
  39. "static",
  40. "ja",
  41. "zh-cn",
  42. "gitbook",
  43. // "ChangeLog"
  44. ],
  45. editUrl:
  46. "https://github.com/qmk/qmk_firmware/edit/master/docs/",
  47. },
  48. ],
  49. [
  50. "@docusaurus/plugin-client-redirects",
  51. {
  52. // fromExtensions: ['md', 'html'],
  53. redirects: [
  54. // from index.html
  55. {
  56. from: '/adding_a_keyboard_to_qmk',
  57. to: '/hardware_keyboard_guidelines',
  58. },
  59. {
  60. from: '/build_environment_setup',
  61. to: '/newbs_getting_started',
  62. },
  63. {
  64. from: '/cli_dev_configuration',
  65. to: '/cli_configuration',
  66. },
  67. {
  68. from: '/dynamic_macros',
  69. to: '/feature_dynamic_macros',
  70. },
  71. {
  72. from: '/feature_common_shortcuts',
  73. to: '/feature_advanced_keycodes',
  74. },
  75. {
  76. from: '/glossary',
  77. to: '/reference_glossary',
  78. },
  79. {
  80. from: '/key_lock',
  81. to: '/feature_key_lock',
  82. },
  83. {
  84. from: '/make_instructions',
  85. to: '/getting_started_make_guide',
  86. },
  87. {
  88. from: ['/space_cadet_shift', '/feature_space_cadet_shift'],
  89. to: '/feature_space_cadet',
  90. },
  91. {
  92. from: '/getting_started_getting_help',
  93. to: '/support',
  94. },
  95. {
  96. from: '/tap_dance',
  97. to: '/feature_tap_dance',
  98. },
  99. {
  100. from: '/unicode',
  101. to: '/feature_unicode',
  102. },
  103. {
  104. from: '/python_development',
  105. to: '/cli_development',
  106. },
  107. {
  108. from: '/getting_started_build_tools',
  109. to: '/newbs_getting_started',
  110. },
  111. {
  112. from: '/tutorial',
  113. to: '/newbs',
  114. },
  115. // from redirects.json
  116. // {
  117. // from: "/adding_a_keyboard_to_qmk",
  118. // to: "/hardware_keyboard_guidelines"
  119. // },
  120. // {
  121. // from: "/build_environment_setup",
  122. // to: "/getting_started_build_tools"
  123. // },
  124. // {
  125. // from: "/dynamic_macros",
  126. // to: "/feature_dynamic_macros"
  127. // },
  128. // {
  129. // from: "/feature_common_shortcuts",
  130. // to: "/feature_advanced_keycodes"
  131. // },
  132. // {
  133. // from: "/glossary",
  134. // to: "/reference_glossary"
  135. // },
  136. // {
  137. // from: "/key_lock",
  138. // to: "/feature_key_lock"
  139. // },
  140. // {
  141. // from: "/make_instructions",
  142. // to: "/getting_started_make_guide"
  143. // },
  144. // {
  145. // from: "/porting_your_keyboard_to_qmk",
  146. // to: "/hardware_avr"
  147. // },
  148. // {
  149. // from: "/space_cadet_shift",
  150. // to: "/feature_space_cadet_shift"
  151. // },
  152. // {
  153. // from: "/tap_dance",
  154. // to: "/feature_tap_dance"
  155. // },
  156. // {
  157. // from: "/unicode",
  158. // to: "/feature_unicode"
  159. // },
  160. // {
  161. // from: "/python_development",
  162. // to: "/cli_development"
  163. // }
  164. ],
  165. },
  166. ],
  167. ],
  168. themeConfig:
  169. /** @type {import('@docusaurus/preset-classic').ThemeConfig} */
  170. ({
  171. image: "img/qmk-social-card.jpg",
  172. navbar: {
  173. title: "QMK Firmware Docs",
  174. logo: {
  175. alt: "QMK Firmware",
  176. src: "img/qmk-new-light.svg",
  177. srcDark: "img/qmk-new-dark.svg",
  178. width: 32,
  179. height: 32,
  180. },
  181. items: [
  182. // {
  183. // type: 'localeDropdown',
  184. // position: 'right',
  185. // },
  186. {
  187. href: "https://github.com/qmk/qmk_firmware",
  188. label: "GitHub",
  189. position: "right",
  190. },
  191. ],
  192. },
  193. docs: {
  194. sidebar: {
  195. autoCollapseCategories: false,
  196. },
  197. },
  198. footer: {
  199. style: "dark",
  200. links: [
  201. {
  202. title: "Docs",
  203. items: [
  204. {
  205. label: "Docs",
  206. to: "/",
  207. },
  208. ],
  209. },
  210. {
  211. title: "Community",
  212. items: [
  213. {
  214. label: "Discord",
  215. href: "https://discord.gg/Uq7gcHh",
  216. },
  217. {
  218. label: "Reddit",
  219. href: "https://reddit.com/r/olkb",
  220. },
  221. ],
  222. },
  223. {
  224. title: "More",
  225. items: [
  226. {
  227. label: "GitHub",
  228. href: "https://github.com/qmk/qmk_firmware",
  229. },
  230. ],
  231. },
  232. ],
  233. copyright: `Copyright © ${new Date().getFullYear()} QMK. Built with Docusaurus.`,
  234. },
  235. prism: {
  236. theme: lightCodeTheme,
  237. darkTheme: darkCodeTheme,
  238. },
  239. // applied for - will fill out once we hear back
  240. //
  241. // algolia: {
  242. // // The application ID provided by Algolia
  243. // appId: 'YOUR_APP_ID',
  244. // // Public API key: it is safe to commit it
  245. // apiKey: 'YOUR_SEARCH_API_KEY',
  246. // indexName: 'YOUR_INDEX_NAME',
  247. // // Optional: see doc section below
  248. // contextualSearch: true,
  249. // // 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.
  250. // externalUrlRegex: 'external\\.com|domain\\.com',
  251. // // 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
  252. // replaceSearchResultPathname: {
  253. // from: '/docs/', // or as RegExp: /\/docs\//
  254. // to: '/',
  255. // },
  256. // // Optional: Algolia search parameters
  257. // searchParameters: {},
  258. // // Optional: path for search page that enabled by default (`false` to disable it)
  259. // searchPagePath: 'search',
  260. // //... other Algolia params
  261. // },
  262. }),
  263. };
  264. module.exports = config;