1
0

docusaurus.config.js 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  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. const llmTxtPlugin = require('./src/plugins/llm-txt-plugin');
  6. /** @type {import('@docusaurus/types').Config} */
  7. const config = {
  8. title: 'Vendure Docs',
  9. favicon: 'img/logo.webp',
  10. // Set the production url of your site here
  11. url: 'https://docs.vendure.io',
  12. // Set the /<baseUrl>/ pathname under which your site is served
  13. // For GitHub pages deployment, it is often '/<projectName>/'
  14. baseUrl: '/',
  15. // GitHub pages deployment config.
  16. // If you aren't using GitHub pages, you don't need these.
  17. organizationName: 'vendure-ecommerce', // Usually your GitHub org/user name.
  18. projectName: 'vendure', // Usually your repo name.
  19. onBrokenLinks: 'throw',
  20. onBrokenMarkdownLinks: 'warn',
  21. // Even if you don't use internalization, you can use this field to set useful
  22. // metadata like html lang. For example, if your site is Chinese, you may want
  23. // to replace "en" with "zh-Hans".
  24. i18n: {
  25. defaultLocale: 'en',
  26. locales: ['en'],
  27. },
  28. presets: [
  29. [
  30. 'classic',
  31. /** @type {import('@docusaurus/preset-classic').Options} */
  32. ({
  33. docs: {
  34. routeBasePath: '/',
  35. sidebarPath: require.resolve('./sidebars.js'),
  36. editUrl: 'https://github.com/vendure-ecommerce/vendure/blob/master/docs/',
  37. showLastUpdateTime: true,
  38. admonitions: {
  39. keywords: ['cli'],
  40. extendDefaults: true,
  41. },
  42. // exclude: ['user-guide/**/*'],
  43. },
  44. blog: false,
  45. theme: {
  46. customCss: [require.resolve('./src/css/custom.css')],
  47. },
  48. }),
  49. ],
  50. ],
  51. themes: ['docusaurus-theme-search-typesense', '@docusaurus/theme-mermaid'],
  52. markdown: {
  53. mermaid: true,
  54. },
  55. plugins: [llmTxtPlugin],
  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;