Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/julianrubisch/sitepress-pagefind
A Pagefind integration for Sitepress
https://github.com/julianrubisch/sitepress-pagefind
Last synced: 15 days ago
JSON representation
A Pagefind integration for Sitepress
- Host: GitHub
- URL: https://github.com/julianrubisch/sitepress-pagefind
- Owner: julianrubisch
- License: mit
- Created: 2024-06-09T10:36:08.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-06-09T10:49:16.000Z (7 months ago)
- Last Synced: 2024-12-08T17:42:11.589Z (19 days ago)
- Language: Ruby
- Size: 25.4 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: MIT-LICENSE
Awesome Lists containing this project
README
# Sitepress::Pagefind
A [Pagefind](https://pagefind.app/) integration for [Sitepress-Rails](https://sitepress.cc/getting-started/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:```ruby
gem "sitepress-pagefind"
```And then execute:
```bash
$ bundle
```Then run the installer:
```bash
$ bin/rails g sitepress:pagefind:install
```This installs
- the `@pagefind/default-ui` JavaScript package
- a Stimulus controller attachable to a ``
- a template `_search` partial for your convenience.## Usage
To compile a Pagefind index, run the following rake task:```bash
$ 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](https://opensource.org/licenses/MIT).