From adfae7f5288c94ab22b9bf75a9478dc3d0d2515d Mon Sep 17 00:00:00 2001 From: Stefan Krawczyk Date: Fri, 27 Oct 2023 16:51:33 -0500 Subject: [PATCH] Adds Algolia search to hub This is the first commit -- expect tweaks to come. Otherwise following the docusaurus integration instructions. --- contrib/docs/docusaurus.config.js | 30 ++++++++++++++++++++++++++++++ contrib/docs/package-lock.json | 1 + contrib/docs/package.json | 1 + 3 files changed, 32 insertions(+) diff --git a/contrib/docs/docusaurus.config.js b/contrib/docs/docusaurus.config.js index 7d004e002..edd49ca57 100644 --- a/contrib/docs/docusaurus.config.js +++ b/contrib/docs/docusaurus.config.js @@ -150,6 +150,36 @@ const config = { theme: lightCodeTheme, darkTheme: darkCodeTheme, }, + algolia: { + // The application ID provided by Algolia + appId: '7TPE26LXI6', + + // Public API key: it is safe to commit it + apiKey: '135438a0a051d2177e8cb40dca885ed6', + + indexName: 'hub-dagworks', + + // 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', + + //... other Algolia params + insights: true, + }, }), }; diff --git a/contrib/docs/package-lock.json b/contrib/docs/package-lock.json index 1a2fd466c..41e601191 100644 --- a/contrib/docs/package-lock.json +++ b/contrib/docs/package-lock.json @@ -13,6 +13,7 @@ "@docusaurus/plugin-google-gtag": "^2.4.3", "@docusaurus/plugin-sitemap": "^2.4.3", "@docusaurus/preset-classic": "^2.4.3", + "@docusaurus/theme-search-algolia": "^2.4.3", "@mdx-js/react": "^1.6.22", "clsx": "^1.2.1", "prism-react-renderer": "^1.3.5", diff --git a/contrib/docs/package.json b/contrib/docs/package.json index 29fbd0b20..e182bcd39 100644 --- a/contrib/docs/package.json +++ b/contrib/docs/package.json @@ -19,6 +19,7 @@ "@docusaurus/plugin-google-gtag": "^2.4.3", "@docusaurus/plugin-sitemap": "^2.4.3", "@docusaurus/preset-classic": "^2.4.3", + "@docusaurus/theme-search-algolia": "^2.4.3", "@mdx-js/react": "^1.6.22", "clsx": "^1.2.1", "prism-react-renderer": "^1.3.5",