No release in over a year
A Pagefind integration for Sitepress
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

 Project Readme

Sitepress::Pagefind

A Pagefind integration for Sitepress-Rails

Important

For now, this plugin is intended to be used with a mounted Sitepress installation (i.e. sitepress-rails)

Caution

For now the only tested case is one where no dynamic parts (i.e. those pertaining to a logged in user) are embedded in the static Sitepress pages.

Installation

Add this line to your application's Gemfile:

gem "sitepress-pagefind"

And then execute:

$ bundle

Then run the installer:

$ bin/rails g sitepress:pagefind:install

This installs

  • the @pagefind/default-ui JavaScript package
  • a Stimulus controller attachable to a <dialog>
  • a template _search partial for your convenience.

Usage

To compile a Pagefind index, run the following rake task:

$ bin/rails sitepress:pagefind:build

This task will also be invoked by assets:precompile so you don't have to alter your build scripts.

Tip

If you want to opt out of this behavior, just set the SKIP_SITEPRESS_PAGEFIND_BUILD environment variable.

License

The gem is available as open source under the terms of the MIT License.