@itsmatteomanf/astro-pagefind
v0.3.7
Published
Performs the indexing operation for the Pagefind search engine
Downloads
97
Maintainers
Readme
@itsmatteomanf/astro-pagefind
This is an Astro integration that runs the indexing operation for Pagefind directly during Astro's build.
Usage
Prerequisites
You need to be using [email protected]
or higher, and [email protected]
or higher must be installed and in use, as this package just runs the indexing.
Installation
Install the integration automatically using the Astro CLI:
pnpm astro add @itsmatteomanf/astro-pagefind
npx astro add @itsmatteomanf/astro-pagefind
yarn astro add @itsmatteomanf/astro-pagefind
Or install it manually:
- Install the required dependencies
pnpm add @itsmatteomanf/astro-pagefind
npm install @itsmatteomanf/astro-pagefind
yarn add @itsmatteomanf/astro-pagefind
- Add the integration to your astro config
+import pagefind from "@itsmatteomanf/astro-pagefind";
export default defineConfig({
integrations: [
+ pagefind(),
],
});
Configuration
No configuration is necessary for the integration to work.
The configuration object allows configuring some aspects of Pagefind.
const options = {
index: {
rootSelector: undefined,
excludeSelectors: undefined,
forceLanguage: undefined,
keepIndexUrl: undefined,
verbose: undefined,
logfile: undefined,
},
directories: [""],
site: "pagefind",
};
All the settings align with Pagefind's CLI, at https://pagefind.app/docs/config-options/. If the optipon is not listed here, it's not suppoerted by this integration.
Directories are relative to the output directory of your Astro project, so ""
will match the root of the output folder.
Licensing
MIT Licensed. Made with ❤️ by Matteo Manfredi.