Skip to content

Commit d5ecf84

Browse files
inesjikanter
authored andcommitted
Move DocSearch key to env var [ci skip]
1 parent 3c564f9 commit d5ecf84

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

website/meta/site.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
},
2424
"docSearch": {
2525
"appId": "Y1LB128RON",
26-
"apiKey": "bb601a1daab73e2dc66faf2b79564807",
2726
"indexName": "spacy"
2827
},
2928
"binderUrl": "explosion/spacy-io-binder",

website/next.config.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ const nextConfig = withPWA(
3232
ignoreBuildErrors: true,
3333
},
3434
images: { unoptimized: true },
35+
env: {
36+
DOCSEARCH_API_KEY: process.env.DOCSEARCH_API_KEY
37+
}
3538
})
3639
)
3740

website/src/components/search.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
import React, { useEffect, useState } from 'react'
1+
import React from 'react'
22
import PropTypes from 'prop-types'
33
import { DocSearch } from '@docsearch/react'
44
import '@docsearch/css'
55

66
import siteMetadata from '../../meta/site.json'
77

88
export default function Search({ placeholder = 'Search docs' }) {
9-
const { apiKey, indexName, appId } = siteMetadata.docSearch
9+
const apiKey = process.env.DOCSEARCH_API_KEY
10+
const { indexName, appId } = siteMetadata.docSearch
1011
return (
1112
<DocSearch appId={appId} indexName={indexName} apiKey={apiKey} placeholder={placeholder} />
1213
)

0 commit comments

Comments
 (0)