extract indexDomain to env var
This commit is contained in:
parent
551a64d2b1
commit
88fc10e89b
|
@ -6,13 +6,12 @@ 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';
|
||||||
// TODO: Replace Algolia test keys with above env vars when ready
|
|
||||||
return (
|
return (
|
||||||
<DocSearch appId={appId} apiKey={apiKey} indexName={indexName} transformItems={
|
<DocSearch appId={appId} apiKey={apiKey} indexName={indexName} transformItems={
|
||||||
items => items.map(item => ({
|
items => items.map(item => ({
|
||||||
...item,
|
...item,
|
||||||
url: item.url.replace('https://melodious-puffpuff-8e1109.netlify.app', ''),
|
url: item.url.replace(indexDomain, ''),
|
||||||
}))
|
}))
|
||||||
} />
|
} />
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue