Skip to content

Commit

Permalink
Move DocSearch key to env var [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
ines committed Mar 25, 2024
1 parent d410d95 commit 1252370
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 0 additions & 1 deletion website/meta/site.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
},
"docSearch": {
"appId": "Y1LB128RON",
"apiKey": "bb601a1daab73e2dc66faf2b79564807",
"indexName": "spacy"
},
"binderUrl": "explosion/spacy-io-binder",
Expand Down
3 changes: 3 additions & 0 deletions website/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ const nextConfig = withPWA(
ignoreBuildErrors: true,
},
images: { unoptimized: true },
env: {
DOCSEARCH_API_KEY: process.env.DOCSEARCH_API_KEY
}
})
)

Expand Down
5 changes: 3 additions & 2 deletions website/src/components/search.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import React, { useEffect, useState } from 'react'
import React from 'react'
import PropTypes from 'prop-types'
import { DocSearch } from '@docsearch/react'
import '@docsearch/css'

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

export default function Search({ placeholder = 'Search docs' }) {
const { apiKey, indexName, appId } = siteMetadata.docSearch
const apiKey = process.env.DOCSEARCH_API_KEY
const { indexName, appId } = siteMetadata.docSearch
return (
<DocSearch appId={appId} indexName={indexName} apiKey={apiKey} placeholder={placeholder} />
)
Expand Down

0 comments on commit 1252370

Please sign in to comment.