From acff2d04caefafe98c6fc24fe8ca855d7ebe76da Mon Sep 17 00:00:00 2001 From: Anthony Stirling <77850077+Frooodle@users.noreply.github.com.> Date: Sun, 15 Dec 2024 23:59:01 +0000 Subject: [PATCH] search --- docusaurus.config.js | 34 +++++++++++++++++++++++++++++++++- package.json | 1 + 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/docusaurus.config.js b/docusaurus.config.js index 0cc725b..bcf70e0 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -25,7 +25,6 @@ const config = { defaultLocale: 'en', locales: ['en'], }, - themes: ['@docusaurus/theme-search-algolia'], presets: [ [ 'classic', @@ -46,6 +45,39 @@ const config = { themeConfig: /** @type {import('@docusaurus/preset-classic').ThemeConfig} */ ({ + algolia: { + // The application ID provided by Algolia + appId: 'NJB9CKQAIT', + + // Public API key: it is safe to commit it + apiKey: 'c67f84bf0cdec4d1962ac4e0d65fb4e5', + + indexName: 'stirlingpdf', + + // Optional: see doc section below + contextualSearch: true, + + // Optional: Specify domains where the navigation should occur through window.location instead on history.push. Useful when our Algolia config crawls multiple documentation sites and we want to navigate with window.location.href to them. + externalUrlRegex: 'external\\.com|domain\\.com', + + // Optional: Replace parts of the item URLs from Algolia. Useful when using the same search index for multiple deployments using a different baseUrl. You can use regexp or string in the `from` param. For example: localhost:3000 vs myCompany.com/docs + replaceSearchResultPathname: { + from: '/docs/', // or as RegExp: /\/docs\// + to: '/', + }, + + // Optional: Algolia search parameters + searchParameters: {}, + + // Optional: path for search page that enabled by default (`false` to disable it) + searchPagePath: 'search', + + // Optional: whether the insights feature is enabled or not on Docsearch (`false` by default) + insights: false, + + //... other Algolia params + }, + image: 'img/stirling-social-card.png', navbar: { title: 'Stirling-PDF', diff --git a/package.json b/package.json index d3d5529..49b63d4 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "dependencies": { "@docusaurus/core": "^3.3.2", "@docusaurus/preset-classic": "^3.3.2", + "@docusaurus/theme-search-algolia": "^3.6.3", "@mdx-js/react": "^1.6.22", "clsx": "^1.2.1", "prism-react-renderer": "^1.3.5",