From 85fef683646b760abbb30f96a304059c00c04bf0 Mon Sep 17 00:00:00 2001 From: Qian Li Date: Wed, 21 Feb 2024 11:51:04 -0800 Subject: [PATCH 1/2] add a search bar --- docusaurus.config.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/docusaurus.config.js b/docusaurus.config.js index b6389e2c..4398427b 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -115,6 +115,35 @@ const config = { tableOfContents: { maxHeadingLevel:5, }, + algolia: { + // The application ID provided by Algolia + appId: 'UY2VKOMIL2', + + // Public API key: it is safe to commit it + apiKey: '283b0ed33db1f1f2a1955ba0aa83671f', + + indexName: 'dbos', + + // 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: 'docs\\.dbos\\.dev', + + // 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 + }, }), }; From c50688e9d95acfed3e5b4d904ca1960f668d3504 Mon Sep 17 00:00:00 2001 From: Qian Li Date: Wed, 21 Feb 2024 13:03:54 -0800 Subject: [PATCH 2/2] jump within local pages --- docusaurus.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docusaurus.config.js b/docusaurus.config.js index 4398427b..89d087a9 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -128,7 +128,7 @@ const config = { 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: 'docs\\.dbos\\.dev', + // externalUrlRegex: 'docs\\.dbos\\.dev', // 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: {