docusaurus.config.js 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. // @ts-check
  2. // Note: type annotations allow type checking and IDEs autocompletion
  3. const lightCodeTheme = require('prism-react-renderer/themes/nightOwlLight');
  4. const darkCodeTheme = require('prism-react-renderer/themes/nightOwl');
  5. /** @type {import('@docusaurus/types').Config} */
  6. const config = {
  7. title: 'Vendure Docs',
  8. favicon: 'img/logo.webp',
  9. // Set the production url of your site here
  10. url: 'https://docs.vendure.io',
  11. // Set the /<baseUrl>/ pathname under which your site is served
  12. // For GitHub pages deployment, it is often '/<projectName>/'
  13. baseUrl: '/',
  14. // GitHub pages deployment config.
  15. // If you aren't using GitHub pages, you don't need these.
  16. organizationName: 'vendure-ecommerce', // Usually your GitHub org/user name.
  17. projectName: 'vendure', // Usually your repo name.
  18. onBrokenLinks: 'throw',
  19. onBrokenMarkdownLinks: 'warn',
  20. // Even if you don't use internalization, you can use this field to set useful
  21. // metadata like html lang. For example, if your site is Chinese, you may want
  22. // to replace "en" with "zh-Hans".
  23. i18n: {
  24. defaultLocale: 'en',
  25. locales: ['en'],
  26. },
  27. presets: [
  28. [
  29. '@docusaurus/preset-classic',
  30. /** @type {import('@docusaurus/preset-classic').Options} */
  31. ({
  32. docs: {
  33. routeBasePath: '/',
  34. sidebarPath: require.resolve('./sidebars.js'),
  35. editUrl: 'https://github.com/vendure-ecommerce/vendure/blob/master/docs/',
  36. showLastUpdateTime: true,
  37. admonitions: {
  38. keywords: ['cli'],
  39. extendDefaults: true,
  40. },
  41. // exclude: ['user-guide/**/*'],
  42. },
  43. blog: false,
  44. theme: {
  45. customCss: [
  46. require.resolve('./src/css/custom.css'),
  47. require.resolve('./src/css/layout.css'),
  48. require.resolve('./src/css/overrides.css'),
  49. require.resolve('./src/css/code-blocks.css'),
  50. ],
  51. },
  52. }),
  53. ],
  54. ],
  55. themes: ['docusaurus-theme-search-typesense'],
  56. themeConfig:
  57. /** @type {import('@docusaurus/preset-classic').ThemeConfig} */
  58. ({
  59. colorMode: {
  60. defaultMode: 'dark',
  61. disableSwitch: false,
  62. respectPrefersColorScheme: true,
  63. },
  64. // Replace with your project's social card
  65. image: 'img/docusaurus-social-card.jpg',
  66. navbar: {
  67. title: '',
  68. logo: {
  69. alt: 'Vendure logo',
  70. src: 'img/logo.webp',
  71. },
  72. items: [
  73. {
  74. type: 'docSidebar',
  75. sidebarId: 'learnSidebar',
  76. position: 'left',
  77. label: 'Learn',
  78. },
  79. {
  80. type: 'docSidebar',
  81. sidebarId: 'referenceSidebar',
  82. position: 'left',
  83. label: 'Reference',
  84. },
  85. {
  86. type: 'docSidebar',
  87. sidebarId: 'userGuideSidebar',
  88. position: 'left',
  89. label: 'User Guide',
  90. },
  91. {
  92. href: 'https://vendure.io',
  93. label: 'vendure.io',
  94. position: 'right',
  95. },
  96. {
  97. href: 'https://github.com/vendure-ecommerce/vendure',
  98. label: 'GitHub',
  99. position: 'right',
  100. },
  101. ],
  102. },
  103. docs: {
  104. sidebar: {
  105. autoCollapseCategories: true,
  106. },
  107. },
  108. footer: {
  109. links: [
  110. {
  111. title: 'Resources',
  112. items: [
  113. {
  114. label: 'vendure.io',
  115. href: 'https://www.vendure.io',
  116. },
  117. {
  118. label: 'GitHub',
  119. href: 'https://github.com/vendure-ecommerce/vendure',
  120. },
  121. ],
  122. },
  123. {
  124. title: 'Community',
  125. items: [
  126. {
  127. label: 'Discord',
  128. href: 'https://vendure.io/community/',
  129. },
  130. {
  131. label: 'Twitter',
  132. href: 'https://twitter.com/vendure_io',
  133. },
  134. {
  135. label: 'YouTube',
  136. href: 'https://www.youtube.com/@vendure_io',
  137. },
  138. ],
  139. },
  140. ],
  141. copyright: `Copyright © ${new Date().getFullYear()} Vendure GmbH.`,
  142. },
  143. prism: {
  144. theme: lightCodeTheme,
  145. darkTheme: darkCodeTheme,
  146. additionalLanguages: ['docker', 'bash'],
  147. },
  148. typesense: {
  149. // Replace this with the name of your index/collection.
  150. // It should match the "index_name" entry in the scraper's "config.json" file.
  151. typesenseCollectionName: 'vendure-docs',
  152. typesenseServerConfig: {
  153. nodes: [
  154. {
  155. host: 'gly437ru8znh5oaep-1.a1.typesense.net',
  156. port: 443,
  157. protocol: 'https',
  158. },
  159. {
  160. host: 'gly437ru8znh5oaep-2.a1.typesense.net',
  161. port: 443,
  162. protocol: 'https',
  163. },
  164. {
  165. host: 'gly437ru8znh5oaep-3.a1.typesense.net',
  166. port: 443,
  167. protocol: 'https',
  168. },
  169. ],
  170. apiKey: 'gm6HqoeTBT7W1zcGPiUHDWhasQlPMzI7',
  171. },
  172. // Optional: Typesense search parameters: https://typesense.org/docs/0.24.0/api/search.html#search-parameters
  173. typesenseSearchParameters: {},
  174. // Optional
  175. contextualSearch: true,
  176. },
  177. }),
  178. };
  179. module.exports = config;