jekyll-pagefind

jekyll-pagefind is a Jekyll plugin that runs the Pagefind CLI after your site is written. It lets you keep search indexing as part of the normal Jekyll build instead of running a separate manual step.

Installation

Add the gem to your site's Gemfile:

gem "jekyll-pagefind"

Then install dependencies:

bundle install

Enable the plugin in your Jekyll configuration:

plugins:
    - jekyll-pagefind

This plugin shells out to the Pagefind CLI, so make sure pagefind is installed and available on your system. For example:

npm install -g pagefind

Usage

With the plugin enabled, a normal Jekyll build will run Pagefind after the site output has been written:

bundle exec jekyll build

By default the plugin executes:

./pagefind --site _site

You can override the Pagefind executable location in _config.yml:

pagefind:
    pf_location: /path/to/pagefind

That value is used to build the command:

/path/to/pagefind --site _site

Development

After checking out the repository, run:

bin/setup

To build the gem locally:

gem build jekyll-pagefind.gemspec

To install it into your local Ruby environment:

bundle exec rake install

Contributing

Bug reports and pull requests are welcome at https://github.com/phothinmg/jekyll-pagefind.

License

This project is available under the terms of the MIT License.

Code of Conduct

Please review CODE_OF_CONDUCT.md before contributing.