feat(theme-algolia): add option.replaceSearchResultPathname to process/replaceAll search result urls

#8428
This commit is contained in:
sebastienlorber 2023-01-26 16:36:26 +01:00
parent e5b0707fab
commit deb376e4a6
18 changed files with 214 additions and 51 deletions

View file

@ -104,6 +104,12 @@ module.exports = {
// 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: {},