docusaurus.config.js 5.7 KB

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