@itsmatteomanf/astro-pagefind

0.3.5 • Public • Published

@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 astro@4.0.0 or higher, and pagefind@1.0.0 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:

  1. Install the required dependencies
pnpm add @itsmatteomanf/astro-pagefind
npm install @itsmatteomanf/astro-pagefind
yarn add @itsmatteomanf/astro-pagefind
  1. 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.

Package Sidebar

Install

npm i @itsmatteomanf/astro-pagefind

Weekly Downloads

87

Version

0.3.5

License

MIT

Unpacked Size

12 kB

Total Files

6

Last publish

Collaborators

  • itsmatteomanf