docusaurus.config.js 6.6 KB

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