Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[deploy_website] Fix multi-website search (#5801)
- Loading branch information
1 parent
d563887
commit 96e9a9b
Showing
7 changed files
with
184 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
patches/@docusaurus+theme-search-algolia+2.0.0-alpha.72.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
diff --git a/node_modules/@docusaurus/theme-search-algolia/src/theme/SearchBar/index.js b/node_modules/@docusaurus/theme-search-algolia/src/theme/SearchBar/index.js | ||
index 033a105..a4148d8 100644 | ||
--- a/node_modules/@docusaurus/theme-search-algolia/src/theme/SearchBar/index.js | ||
+++ b/node_modules/@docusaurus/theme-search-algolia/src/theme/SearchBar/index.js | ||
@@ -16,6 +16,7 @@ import useSearchQuery from '@theme/hooks/useSearchQuery'; | ||
import {DocSearchButton, useDocSearchKeyboardEvents} from '@docsearch/react'; | ||
import useAlgoliaContextualFacetFilters from '@theme/hooks/useAlgoliaContextualFacetFilters'; | ||
import {translate} from '@docusaurus/Translate'; | ||
+import {CallEnum} from '@algolia/transporter'; | ||
|
||
let DocSearchModal = null; | ||
|
||
@@ -101,7 +102,7 @@ function DocSearch({contextualSearch, ...props}) { | ||
|
||
const navigator = useRef({ | ||
navigate({itemUrl}) { | ||
- history.push(itemUrl); | ||
+ window.location.assign(itemUrl); | ||
}, | ||
}).current; | ||
|
||
@@ -132,6 +133,13 @@ function DocSearch({contextualSearch, ...props}) { | ||
siteMetadata.docusaurusVersion, | ||
); | ||
|
||
+ const algoliaHost = 'the-guild.dev/api/algolia'; | ||
+ searchClient.transporter.hosts.forEach(host => { | ||
+ if ((host.accept & CallEnum.Read) !== 0) { | ||
+ host.url = algoliaHost; | ||
+ } | ||
+ }); | ||
+ | ||
return searchClient; | ||
}, | ||
[siteMetadata.docusaurusVersion], |
13 changes: 0 additions & 13 deletions
13
patches/@docusaurus+theme-search-algolia+2.0.0-alpha.ffe8b6106.patch
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.