docusaurus.config.js 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. // @ts-check
  2. // Note: type annotations allow type checking and IDEs autocompletion
  3. // Set the env variable to false so the excalidraw npm package doesn't throw
  4. // process undefined as docusaurus doesn't expose env variables by default
  5. process.env.IS_PREACT = "false";
  6. /** @type {import('@docusaurus/types').Config} */
  7. const config = {
  8. title: "Excalidraw developer docs",
  9. tagline:
  10. "For Excalidraw contributors or those integrating the Excalidraw editor",
  11. url: "https://docs.excalidraw.com",
  12. baseUrl: "/",
  13. onBrokenLinks: "throw",
  14. onBrokenMarkdownLinks: "warn",
  15. favicon: "img/favicon.png",
  16. organizationName: "Excalidraw", // Usually your GitHub org/user name.
  17. projectName: "excalidraw", // Usually your repo name.
  18. // Even if you don't use internalization, you can use this field to set useful
  19. // metadata like html lang. For example, if your site is Chinese, you may want
  20. // to replace "en" with "zh-Hans".
  21. i18n: {
  22. defaultLocale: "en",
  23. locales: ["en"],
  24. },
  25. presets: [
  26. [
  27. "classic",
  28. /** @type {import('@docusaurus/preset-classic').Options} */
  29. ({
  30. docs: {
  31. sidebarPath: require.resolve("./sidebars.js"),
  32. // Please change this to your repo.
  33. editUrl:
  34. "https://github.com/excalidraw/excalidraw/tree/master/dev-docs/",
  35. showLastUpdateAuthor: true,
  36. showLastUpdateTime: true,
  37. },
  38. theme: {
  39. customCss: [require.resolve("./src/css/custom.scss")],
  40. },
  41. }),
  42. ],
  43. ],
  44. themeConfig:
  45. /** @type {import('@docusaurus/preset-classic').ThemeConfig} */
  46. ({
  47. colorMode: {
  48. respectPrefersColorScheme: true,
  49. },
  50. navbar: {
  51. title: "Excalidraw",
  52. logo: {
  53. alt: "Excalidraw Logo",
  54. src: "img/logo.svg",
  55. },
  56. items: [
  57. {
  58. to: "/docs",
  59. position: "left",
  60. label: "Docs",
  61. },
  62. {
  63. to: "https://plus.excalidraw.com/blog",
  64. label: "Blog",
  65. position: "left",
  66. },
  67. {
  68. to: "https://github.com/excalidraw/excalidraw",
  69. label: "GitHub",
  70. position: "right",
  71. },
  72. ],
  73. },
  74. footer: {
  75. style: "dark",
  76. links: [
  77. {
  78. title: "Docs",
  79. items: [
  80. {
  81. label: "Get Started",
  82. to: "/docs",
  83. },
  84. ],
  85. },
  86. {
  87. title: "Community",
  88. items: [
  89. {
  90. label: "Discord",
  91. href: "https://discord.gg/UexuTaE",
  92. },
  93. {
  94. label: "Twitter",
  95. href: "https://twitter.com/excalidraw",
  96. },
  97. {
  98. label: "Linkedin",
  99. href: "https://www.linkedin.com/company/excalidraw",
  100. },
  101. ],
  102. },
  103. {
  104. title: "More",
  105. items: [
  106. {
  107. label: "Blog",
  108. to: "https://plus.excalidraw.com/blog",
  109. },
  110. {
  111. label: "GitHub",
  112. to: "https://github.com/excalidraw/excalidraw",
  113. },
  114. ],
  115. },
  116. ],
  117. copyright: `Copyright © 2023 Excalidraw community. Built with Docusaurus ❤️`,
  118. },
  119. prism: {
  120. theme: require("prism-react-renderer/themes/dracula"),
  121. },
  122. image: "img/og-image-2.png",
  123. docs: {
  124. sidebar: {
  125. hideable: true,
  126. },
  127. },
  128. tableOfContents: {
  129. maxHeadingLevel: 4,
  130. },
  131. algolia: {
  132. appId: "8FEAOD28DI",
  133. apiKey: "4b07cca33ff2d2919bc95ff98f148e9e",
  134. indexName: "excalidraw",
  135. },
  136. }),
  137. themes: ["@docusaurus/theme-live-codeblock"],
  138. plugins: [
  139. "docusaurus-plugin-sass",
  140. [
  141. "docusaurus2-dotenv",
  142. {
  143. systemvars: true,
  144. },
  145. ],
  146. function () {
  147. return {
  148. name: "disable-fully-specified-error",
  149. configureWebpack() {
  150. return {
  151. module: {
  152. rules: [
  153. {
  154. test: /\.m?js$/,
  155. resolve: {
  156. fullySpecified: false,
  157. },
  158. },
  159. ],
  160. },
  161. optimization: {
  162. // disable terser minification
  163. minimize: false,
  164. },
  165. };
  166. },
  167. };
  168. },
  169. ],
  170. };
  171. module.exports = config;