Skip to content

Conversation

@fchasen
Copy link
Collaborator

@fchasen fchasen commented Oct 24, 2025

Checklist

Please put an X within the brackets that apply [X].

  • I have read the CONTRIBUTING.md file

  • I have made my changes in a new branch and not directly in the main branch

  • This pull request is ready for final review by the Quire team

Please briefly describe the goal of this pull request and how it may impact Quire's functionality.

This switches from using Lunr for search to using PageFind. PageFind allows for more complex indexes that include figures and object data, search ranking of page sub-results and faster retrieval using their API and the wasm index that it outputs.

Does this pull request necessitate changes to Quire's documentation?

These changes only update the indexing and search API, maintaining the existing search UI and configuration.

Please describe the changes you made, and call out any details you think are particularly relevant for the Quire team to note in their review.

  • Adds the pagefind library and removes lunr
  • Updates the search plugin to index HTML pages and figures using a new SearchIndex class
  • Output the search index to _search along with the frontend API files that PageFind builds
  • Adds pagefind data attributes as meta tags and on .quire-page to pass page metadata to the index
  • Updates the existing search UI to use the pagefind API
  • Adds the Sinon library for creating test mocks
  • Adds tests for SearchIndex using mocks for the pagefind methods
  • Bundles the pagefind search API and imports it when loadSearchData is called, so pagefind will load the index using wasm.

@fchasen fchasen requested review from Copilot and removed request for Copilot October 29, 2025 16:03
Copy link
Member

@mphstudios mphstudios left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fchasen this pull-request will need recent changes on main and to update the package version rc candidate number before being merged.

- Adds the `pagefind` library and `removes` lunr
- Updates the search plugin to index HTML pages and figures using a new `SearchIndex` class
- Output the search index to `_search` along with the frontend API files that PageFind builds
- Adds pagefind data attributes as meta tags and on `.quire-page` to pass page metadata to the index
- Updates the existing search UI to use the pagefind API
- Adds the Sinon library for creating test mocks
- Adds tests for SearchIndex using mocks for the pagefind methods
- Bundles the pagefind search API and imports it when `loadSearchData` is called, so  pagefind will load the index using wasm.
@fchasen fchasen requested a review from mphstudios November 20, 2025 17:57
@geealbers
Copy link
Member

@fchasen I'm getting duplicate search results when I have the url in publication.yaml set to include a sub-directory, like:

url: 'https://quire.reclaim.hosting/test-pagefind/'

When I run quire preview with this, search on localhost works fine:

Screenshot 2025-11-25 at 11 27 42 AM

But when I run quire build and deploy the files, the search results are all doubled:

Screenshot 2025-11-25 at 11 28 47 AM

You can see the deployed site here: https://quire.reclaim.hosting/test-pagefind/. Let me know if there's anything else I can provide to help track down the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants