1
0

docusaurus.config.js 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  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: [
  47. require.resolve('./src/css/custom.css'),
  48. ],
  49. },
  50. }),
  51. ],
  52. ],
  53. themes: ['docusaurus-theme-search-typesense'],
  54. plugins: [llmTxtPlugin],
  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. type: 'docSidebar',
  86. sidebarId: 'userGuideSidebar',
  87. position: 'left',
  88. label: 'User Guide',
  89. },
  90. {
  91. href: 'https://vendure.io',
  92. label: 'vendure.io',
  93. position: 'right',
  94. },
  95. {
  96. href: 'https://github.com/vendure-ecommerce/vendure',
  97. label: 'GitHub',
  98. position: 'right',
  99. },
  100. ],
  101. },
  102. docs: {
  103. sidebar: {
  104. autoCollapseCategories: true,
  105. },
  106. },
  107. footer: {
  108. links: [
  109. {
  110. title: 'Resources',
  111. items: [
  112. {
  113. label: 'vendure.io',
  114. href: 'https://www.vendure.io',
  115. },
  116. {
  117. label: 'GitHub',
  118. href: 'https://github.com/vendure-ecommerce/vendure',
  119. },
  120. ],
  121. },
  122. {
  123. title: 'Community',
  124. items: [
  125. {
  126. label: 'Discord',
  127. href: 'https://vendure.io/community/',
  128. },
  129. {
  130. label: 'Twitter',
  131. href: 'https://twitter.com/vendure_io',
  132. },
  133. {
  134. label: 'YouTube',
  135. href: 'https://www.youtube.com/@vendure_io',
  136. },
  137. ],
  138. },
  139. ],
  140. copyright: `Copyright © ${new Date().getFullYear()} Vendure GmbH.`,
  141. },
  142. prism: {
  143. theme: lightCodeTheme,
  144. darkTheme: darkCodeTheme,
  145. additionalLanguages: ['docker', 'bash'],
  146. },
  147. typesense: {
  148. // Replace this with the name of your index/collection.
  149. // It should match the "index_name" entry in the scraper's "config.json" file.
  150. typesenseCollectionName: 'vendure-docs',
  151. typesenseServerConfig: {
  152. nodes: [
  153. {
  154. host: 'gly437ru8znh5oaep-1.a1.typesense.net',
  155. port: 443,
  156. protocol: 'https',
  157. },
  158. {
  159. host: 'gly437ru8znh5oaep-2.a1.typesense.net',
  160. port: 443,
  161. protocol: 'https',
  162. },
  163. {
  164. host: 'gly437ru8znh5oaep-3.a1.typesense.net',
  165. port: 443,
  166. protocol: 'https',
  167. },
  168. ],
  169. apiKey: 'gm6HqoeTBT7W1zcGPiUHDWhasQlPMzI7',
  170. },
  171. // Optional: Typesense search parameters: https://typesense.org/docs/0.24.0/api/search.html#search-parameters
  172. typesenseSearchParameters: {},
  173. // Optional
  174. contextualSearch: true,
  175. },
  176. }),
  177. };
  178. module.exports = config;