mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-15 06:35:20 -07:00
feat(search): add pagefind provider support
Add Pagefind indexing and browser search adapters behind a provider switch. This lets prebuild generate either Stork or Pagefind search artifacts and lets the existing search UI run against Pagefind while preserving scoped filters, excerpts, and result metadata.
This commit is contained in:
parent
727f84e4c2
commit
e1da6eb880
12 changed files with 690 additions and 65 deletions
18
helpers/search/config.js
Normal file
18
helpers/search/config.js
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
export const defaultSearchProvider = 'pagefind'
|
||||
|
||||
export const supportedSearchProviders = new Set([
|
||||
'pagefind',
|
||||
'stork'
|
||||
])
|
||||
|
||||
export function getSearchProvider ( rawProvider = defaultSearchProvider ) {
|
||||
const provider = ( rawProvider || defaultSearchProvider ).toLowerCase()
|
||||
|
||||
if ( supportedSearchProviders.has( provider ) ) {
|
||||
return provider
|
||||
}
|
||||
|
||||
console.warn(`Unknown search provider "${ provider }", falling back to "${ defaultSearchProvider }"`)
|
||||
|
||||
return defaultSearchProvider
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue