docusaurus.config.js 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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: [
  40. require.resolve("./src/css/custom.scss"),
  41. require.resolve("../src/packages/excalidraw/example/App.scss"),
  42. ],
  43. },
  44. }),
  45. ],
  46. ],
  47. themeConfig:
  48. /** @type {import('@docusaurus/preset-classic').ThemeConfig} */
  49. ({
  50. colorMode: {
  51. respectPrefersColorScheme: true,
  52. },
  53. navbar: {
  54. title: "Excalidraw",
  55. logo: {
  56. alt: "Excalidraw Logo",
  57. src: "img/logo.svg",
  58. },
  59. items: [
  60. {
  61. to: "/docs",
  62. position: "left",
  63. label: "Docs",
  64. },
  65. {
  66. to: "https://blog.excalidraw.com",
  67. label: "Blog",
  68. position: "left",
  69. },
  70. {
  71. to: "https://github.com/excalidraw/excalidraw",
  72. label: "GitHub",
  73. position: "right",
  74. },
  75. ],
  76. },
  77. footer: {
  78. style: "dark",
  79. links: [
  80. {
  81. title: "Docs",
  82. items: [
  83. {
  84. label: "Get Started",
  85. to: "/docs",
  86. },
  87. ],
  88. },
  89. {
  90. title: "Community",
  91. items: [
  92. {
  93. label: "Discord",
  94. href: "https://discord.gg/UexuTaE",
  95. },
  96. {
  97. label: "Twitter",
  98. href: "https://twitter.com/excalidraw",
  99. },
  100. {
  101. label: "Linkedin",
  102. href: "https://www.linkedin.com/company/excalidraw",
  103. },
  104. ],
  105. },
  106. {
  107. title: "More",
  108. items: [
  109. {
  110. label: "Blog",
  111. to: "https://blog.excalidraw.com",
  112. },
  113. {
  114. label: "GitHub",
  115. to: "https://github.com/excalidraw/excalidraw",
  116. },
  117. ],
  118. },
  119. ],
  120. copyright: `Copyright © 2023 Excalidraw community. Built with Docusaurus ❤️`,
  121. },
  122. prism: {
  123. theme: require("prism-react-renderer/themes/dracula"),
  124. },
  125. image: "img/og-image-2.png",
  126. docs: {
  127. sidebar: {
  128. hideable: true,
  129. },
  130. },
  131. tableOfContents: {
  132. maxHeadingLevel: 4,
  133. },
  134. algolia: {
  135. appId: "8FEAOD28DI",
  136. apiKey: "4b07cca33ff2d2919bc95ff98f148e9e",
  137. indexName: "excalidraw",
  138. },
  139. }),
  140. themes: ["@docusaurus/theme-live-codeblock"],
  141. plugins: [
  142. "docusaurus-plugin-sass",
  143. [
  144. "docusaurus2-dotenv",
  145. {
  146. systemvars: true,
  147. },
  148. ],
  149. ],
  150. };
  151. module.exports = config;