1
0

docusaurus.config.js 6.4 KB

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