1
0

docusaurus.config.js 6.7 KB

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