Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@itsmatteomanf/astro-pagefind

itsmatteomanf1.2kMIT0.4.0TypeScript support: included

Performs the indexing operation for the Pagefind search engine

astro-integration, astro-component, withastro, astro, pagefind, search, search-engine, search-index, search-engine-index, search-engine-optimization, seo

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 `astro@4.0.0or higher, andpagefind@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.