docusaurus.config.js 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  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/vendurehq/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. announcementBar: {
  60. id: 'new_docs_experience',
  61. content: '✨ Try the <a href="https://staging.docs.vendure.io">new docs experience</a>!',
  62. backgroundColor: '#17c1ff',
  63. textColor: '#000212',
  64. isCloseable: true,
  65. },
  66. colorMode: {
  67. defaultMode: 'dark',
  68. disableSwitch: false,
  69. respectPrefersColorScheme: true,
  70. },
  71. // Replace with your project's social card
  72. image: 'img/docusaurus-social-card.jpg',
  73. navbar: {
  74. title: '',
  75. logo: {
  76. alt: 'Vendure logo',
  77. src: 'img/logo.webp',
  78. },
  79. items: [
  80. {
  81. type: 'docSidebar',
  82. sidebarId: 'learnSidebar',
  83. position: 'left',
  84. label: 'Learn',
  85. },
  86. {
  87. type: 'docSidebar',
  88. sidebarId: 'referenceSidebar',
  89. position: 'left',
  90. label: 'Reference',
  91. },
  92. {
  93. type: 'docSidebar',
  94. sidebarId: 'userGuideSidebar',
  95. position: 'left',
  96. label: 'User Guide',
  97. },
  98. {
  99. href: 'https://vendure.io',
  100. label: 'vendure.io',
  101. position: 'right',
  102. },
  103. {
  104. href: 'https://github.com/vendurehq/vendure',
  105. label: 'GitHub',
  106. position: 'right',
  107. },
  108. ],
  109. },
  110. docs: {
  111. sidebar: {
  112. autoCollapseCategories: true,
  113. },
  114. },
  115. footer: {
  116. links: [
  117. {
  118. title: 'Resources',
  119. items: [
  120. {
  121. label: 'vendure.io',
  122. href: 'https://www.vendure.io',
  123. },
  124. {
  125. label: 'GitHub',
  126. href: 'https://github.com/vendurehq/vendure',
  127. },
  128. ],
  129. },
  130. {
  131. title: 'Community',
  132. items: [
  133. {
  134. label: 'Discord',
  135. href: 'https://vendure.io/community/',
  136. },
  137. {
  138. label: 'Twitter',
  139. href: 'https://twitter.com/vendure_io',
  140. },
  141. {
  142. label: 'YouTube',
  143. href: 'https://www.youtube.com/@vendure_io',
  144. },
  145. ],
  146. },
  147. ],
  148. copyright: `Copyright © ${new Date().getFullYear()} Vendure GmbH.`,
  149. },
  150. prism: {
  151. theme: lightCodeTheme,
  152. darkTheme: darkCodeTheme,
  153. additionalLanguages: ['docker', 'bash'],
  154. },
  155. typesense: {
  156. // Replace this with the name of your index/collection.
  157. // It should match the "index_name" entry in the scraper's "config.json" file.
  158. typesenseCollectionName: 'vendure-docs',
  159. typesenseServerConfig: {
  160. nodes: [
  161. {
  162. host: 'gly437ru8znh5oaep-1.a1.typesense.net',
  163. port: 443,
  164. protocol: 'https',
  165. },
  166. {
  167. host: 'gly437ru8znh5oaep-2.a1.typesense.net',
  168. port: 443,
  169. protocol: 'https',
  170. },
  171. {
  172. host: 'gly437ru8znh5oaep-3.a1.typesense.net',
  173. port: 443,
  174. protocol: 'https',
  175. },
  176. ],
  177. apiKey: 'gm6HqoeTBT7W1zcGPiUHDWhasQlPMzI7',
  178. },
  179. // Optional: Typesense search parameters: https://typesense.org/docs/0.24.0/api/search.html#search-parameters
  180. typesenseSearchParameters: {},
  181. // Optional
  182. contextualSearch: true,
  183. },
  184. }),
  185. };
  186. module.exports = config;