docusaurus.config.js 5.7 KB

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