Pagefind CLI configuration sources

Pagefind can be configured through CLI flags, environment variables, or configuration files. Values will be merged from all sources, with CLI flags overriding environment variables, and environment variables overriding configuration files.

#Config files

Pagefind will look for a pagefind.toml, pagefind.yml, pagefind.yaml, or pagefind.json file in the directory that you have run the command in.

# pagefind.yml
site: public
output_subdir: pagefind
npx pagefind

#Environment variables

Pagefind will load any values via a PAGEFIND_* environment variable.

export PAGEFIND_OUTPUT_SUBDIR="pagefind"
PAGEFIND_SITE="public" npx pagefind

#CLI flags

Pagefind can be passed CLI flags directly.

npx pagefind --site public --output-subdir pagefind