docusaurus.config.js 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  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. 'classic',
  30. /** @type {import('@docusaurus/preset-classic').Options} */
  31. ({
  32. docs: {
  33. routeBasePath: '/',
  34. sidebarPath: require.resolve('./sidebars.js'),
  35. // Please change this to your repo.
  36. // Remove this to remove the "edit this page" links.
  37. editUrl: 'https://github.com/vendure-ecommerce/vendure/tree/new-docs/docs/',
  38. showLastUpdateTime: true,
  39. },
  40. blog: false,
  41. theme: {
  42. customCss: [
  43. require.resolve('./src/css/custom.css'),
  44. require.resolve('./src/css/layout.css'),
  45. require.resolve('./src/css/overrides.css'),
  46. require.resolve('./src/css/code-blocks.css'),
  47. ],
  48. },
  49. }),
  50. ],
  51. ],
  52. themes: ['docusaurus-theme-search-typesense'],
  53. themeConfig:
  54. /** @type {import('@docusaurus/preset-classic').ThemeConfig} */
  55. ({
  56. colorMode: {
  57. defaultMode: 'dark',
  58. disableSwitch: false,
  59. respectPrefersColorScheme: true,
  60. },
  61. // Replace with your project's social card
  62. image: 'img/docusaurus-social-card.jpg',
  63. navbar: {
  64. title: '',
  65. logo: {
  66. alt: 'Vendure logo',
  67. src: 'img/logo.webp',
  68. },
  69. items: [
  70. {
  71. type: 'docSidebar',
  72. sidebarId: 'learnSidebar',
  73. position: 'left',
  74. label: 'Learn',
  75. },
  76. {
  77. type: 'docSidebar',
  78. sidebarId: 'referenceSidebar',
  79. position: 'left',
  80. label: 'Reference',
  81. },
  82. {
  83. href: 'https://vendure.io',
  84. label: 'vendure.io',
  85. position: 'right',
  86. },
  87. {
  88. href: 'https://github.com/vendure-ecommerce/vendure',
  89. label: 'GitHub',
  90. position: 'right',
  91. },
  92. ],
  93. },
  94. docs: {
  95. sidebar: {
  96. autoCollapseCategories: true,
  97. },
  98. },
  99. footer: {
  100. links: [
  101. {
  102. title: 'Resources',
  103. items: [
  104. {
  105. label: 'vendure.io',
  106. href: 'https://www.vendure.io',
  107. },
  108. {
  109. label: 'GitHub',
  110. href: 'https://github.com/vendure-ecommerce/vendure',
  111. },
  112. ],
  113. },
  114. {
  115. title: 'Community',
  116. items: [
  117. {
  118. label: 'Discord',
  119. href: 'https://vendure.io/community/',
  120. },
  121. {
  122. label: 'Twitter',
  123. href: 'https://twitter.com/vendure_io',
  124. },
  125. {
  126. label: 'YouTube',
  127. href: 'https://www.youtube.com/@vendure_io',
  128. },
  129. ],
  130. },
  131. ],
  132. copyright: `Copyright © ${new Date().getFullYear()} Vendure GmbH.`,
  133. },
  134. prism: {
  135. theme: lightCodeTheme,
  136. darkTheme: darkCodeTheme,
  137. additionalLanguages: ['docker', 'bash'],
  138. },
  139. typesense: {
  140. // Replace this with the name of your index/collection.
  141. // It should match the "index_name" entry in the scraper's "config.json" file.
  142. typesenseCollectionName: 'vendure-docs',
  143. typesenseServerConfig: {
  144. nodes: [
  145. {
  146. host: 'gly437ru8znh5oaep-1.a1.typesense.net',
  147. port: 443,
  148. protocol: 'https',
  149. },
  150. {
  151. host: 'gly437ru8znh5oaep-2.a1.typesense.net',
  152. port: 443,
  153. protocol: 'https',
  154. },
  155. {
  156. host: 'gly437ru8znh5oaep-3.a1.typesense.net',
  157. port: 443,
  158. protocol: 'https',
  159. },
  160. ],
  161. apiKey: 'gm6HqoeTBT7W1zcGPiUHDWhasQlPMzI7',
  162. },
  163. // Optional: Typesense search parameters: https://typesense.org/docs/0.24.0/api/search.html#search-parameters
  164. typesenseSearchParameters: {},
  165. // Optional
  166. contextualSearch: true,
  167. },
  168. }),
  169. };
  170. module.exports = config;