feat(nx-dev): Add canary index (#25982)
This PR updates the Algolia search feature to now point to a canary index for the master branch. Adding a `.env.local` file allows local development off master. I also added env vars to Vercel for both `master` and `website-19` to point to `nx-canary-production` and `nx-production` respectively.
This commit is contained in:
parent
9d6e5ad48c
commit
af463c4833
@ -83,15 +83,15 @@ export function AlgoliaSearch({
|
||||
type="button"
|
||||
ref={searchButtonRef}
|
||||
onClick={handleOpen}
|
||||
className="flex w-full items-center rounded-md bg-white py-1.5 px-2 text-sm leading-4 ring-1 ring-slate-300 transition dark:bg-slate-700 dark:ring-slate-900"
|
||||
className="flex w-full items-center rounded-md bg-white px-2 py-1.5 text-sm leading-4 ring-1 ring-slate-300 transition dark:bg-slate-700 dark:ring-slate-900"
|
||||
>
|
||||
<MagnifyingGlassIcon className="h-4 w-4 flex-none" />
|
||||
<span className="mx-3 inline-flex text-xs text-slate-300 dark:text-slate-400 md:text-sm">
|
||||
<span className="mx-3 inline-flex text-xs text-slate-300 md:text-sm dark:text-slate-400">
|
||||
Search
|
||||
</span>
|
||||
<span
|
||||
style={{ opacity: browserDetected ? '1' : '0' }}
|
||||
className="ml-auto hidden flex-none rounded-md border border-slate-200 bg-slate-50 px-1 py-0.5 text-xs font-semibold text-slate-500 dark:border-slate-700 dark:bg-slate-800/60 md:block"
|
||||
className="ml-auto hidden flex-none rounded-md border border-slate-200 bg-slate-50 px-1 py-0.5 text-xs font-semibold text-slate-500 md:block dark:border-slate-700 dark:bg-slate-800/60"
|
||||
>
|
||||
<span className="sr-only">Press </span>
|
||||
<kbd className="font-sans">
|
||||
@ -140,9 +140,9 @@ export function AlgoliaSearch({
|
||||
placeholder="Search the docs"
|
||||
initialScrollY={window.scrollY}
|
||||
onClose={handleClose}
|
||||
indexName="nx-production"
|
||||
apiKey="f49a1eb671385f0472a7285556168930"
|
||||
appId="PCTGM1JTQL"
|
||||
indexName={`${process.env.NEXT_PUBLIC_SEARCH_INDEX}`}
|
||||
apiKey={`${process.env.NEXT_PUBLIC_SEARCH_API_KEY}`}
|
||||
appId={`${process.env.NEXT_PUBLIC_SEARCH_APP_ID}`}
|
||||
navigator={{
|
||||
navigate({ itemUrl }) {
|
||||
setIsOpen(false);
|
||||
|
||||
3
nx-dev/nx-dev/.env.local
Normal file
3
nx-dev/nx-dev/.env.local
Normal file
@ -0,0 +1,3 @@
|
||||
NEXT_PUBLIC_SEARCH_INDEX=nx-canary-production
|
||||
NEXT_PUBLIC_SEARCH_API_KEY=07340b85db83fd49c1f904f883cc3ef8
|
||||
NEXT_PUBLIC_SEARCH_APP_ID=PCTGM1JTQL
|
||||
Loading…
x
Reference in New Issue
Block a user