Skip to main content

Configuration

Options

OptionTypeDefaultDescription
forceLanguagestringLanguage code passed to pagefind (e.g. 'ja')
excludeSelectorsstring[].navbar, footer, ...Extra CSS selectors excluded from the index. Added on top of the built-in Docusaurus chrome exclusions, not a replacement
rootSelectorstringRoot element for indexing (default: full body)
excludeGlobsstring[]Glob patterns for pages to exclude from the index

Example

docusaurus.config.ts
const config = {
plugins: [
[
'docusaurus-plugin-pagefind',
{
forceLanguage: 'ja',
// Added on top of the built-in exclusions (navbar, footer, sidebar, …)
excludeSelectors: ['.my-custom-widget'],
excludeGlobs: ['**/internal/**'],
},
],
],
}

Swizzling

The SearchBar component can be swizzled for customization:

pnpm docusaurus swizzle docusaurus-plugin-pagefind SearchBar