1
0

docusaurus.config.js 7.0 KB

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