mirror of
				https://github.com/explosion/spaCy.git
				synced 2025-10-30 23:47:31 +03:00 
			
		
		
		
	Update website to use new Algolia search API
This commit is contained in:
		
							parent
							
								
									00e7bf5ffd
								
							
						
					
					
						commit
						a437ca6737
					
				|  | @ -22,7 +22,8 @@ | |||
|         "list": "89ad33e698" | ||||
|     }, | ||||
|     "docSearch": { | ||||
|         "apiKey": "371e26ed49d29a27bd36273dfdaf89af", | ||||
|         "appId": "Y1LB128RON", | ||||
|         "apiKey": "bb601a1daab73e2dc66faf2b79564807", | ||||
|         "indexName": "spacy" | ||||
|     }, | ||||
|     "binderUrl": "explosion/spacy-io-binder", | ||||
|  |  | |||
|  | @ -6,13 +6,14 @@ import Icon from './icon' | |||
| import classes from '../styles/search.module.sass' | ||||
| 
 | ||||
| export default function Search({ id = 'docsearch', placeholder = 'Search docs', settings = {} }) { | ||||
|     const { apiKey, indexName } = settings | ||||
|     const { apiKey, indexName, appId } = settings | ||||
|     if (!apiKey && !indexName) return null | ||||
|     const [initialized, setInitialized] = useState(false) | ||||
|     useEffect(() => { | ||||
|         if (!initialized) { | ||||
|             setInitialized(true) | ||||
|             window.docsearch({ | ||||
|                 appId, | ||||
|                 apiKey, | ||||
|                 indexName, | ||||
|                 inputSelector: `#${id}`, | ||||
|  |  | |||
|  | @ -41,6 +41,7 @@ export const pageQuery = graphql` | |||
|                 docSearch { | ||||
|                     apiKey | ||||
|                     indexName | ||||
|                     appId | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|  |  | |||
|  | @ -235,6 +235,7 @@ export const pageQuery = graphql` | |||
|                 docSearch { | ||||
|                     apiKey | ||||
|                     indexName | ||||
|                     appId | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user