mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 19:00:46 +00:00
match any domain and remove
makes all search results local to current domain
This commit is contained in:
parent
65bdc4e4dd
commit
f509950c72
1 changed files with 1 additions and 3 deletions
|
|
@ -6,8 +6,6 @@ export const Search: React.FC = () => {
|
||||||
const appId = process.env.NEXT_PUBLIC_ALGOLIA_APP_ID || '';
|
const appId = process.env.NEXT_PUBLIC_ALGOLIA_APP_ID || '';
|
||||||
const apiKey = process.env.NEXT_PUBLIC_ALGOLIA_SEARCH_API_KEY || '';
|
const apiKey = process.env.NEXT_PUBLIC_ALGOLIA_SEARCH_API_KEY || '';
|
||||||
const indexName = process.env.NEXT_PUBLIC_ALGOLIA_BASE_SEARCH_INDEX_NAME || '';
|
const indexName = process.env.NEXT_PUBLIC_ALGOLIA_BASE_SEARCH_INDEX_NAME || '';
|
||||||
const indexDomain =
|
|
||||||
process.env.NEXT_PUBLIC_ALGOLIA_INDEX_DOMAIN || 'https://melodious-puffpuff-8e1109.netlify.app';
|
|
||||||
return (
|
return (
|
||||||
<DocSearch
|
<DocSearch
|
||||||
appId={appId}
|
appId={appId}
|
||||||
|
|
@ -16,7 +14,7 @@ export const Search: React.FC = () => {
|
||||||
transformItems={items =>
|
transformItems={items =>
|
||||||
items.map(item => ({
|
items.map(item => ({
|
||||||
...item,
|
...item,
|
||||||
url: item.url.replace(indexDomain, '')
|
url: item.url.replace(/^https?:\/\/[^\/]+(?=\/)/, '')
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue