docusaurus.config.js 5.3 KB

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