Add PageFind beta V2 (Full Text Search across Site)#2857
Draft
MoshiMoshiMochi wants to merge 22 commits intoMarkBind:masterfrom
Draft
Add PageFind beta V2 (Full Text Search across Site)#2857MoshiMoshiMochi wants to merge 22 commits intoMarkBind:masterfrom
MoshiMoshiMochi wants to merge 22 commits intoMarkBind:masterfrom
Conversation
This added support for configuring Pagefind search indexing via site.json is aimed towards allowing users to declare glob patterns to customize what pages in which directory should be indexed by pagefind.
Initially, I felt that including the root_selector option and force_language option would be useful for pagefind configuration options. But perhaps for now it isn't the most pressing issue so I'm going to exlcude it from the current implementation of pagefind.
21 tasks
This helps resolve an issue with generate() test case within
Site.functional.test.ts. Namely, because Jest's cannot intercept
eval('import("pagefind")') runtime dynamic import used by pagefind.
Hence, for now at least, the error handling would catch this error and
allow the site generation to continue normally.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the purpose of this pull request?
Overview of changes:
Initial version of pagefind (based on #2771)
Original Search Issue is #205
No test cases yet.
Anything you'd like to highlight/discuss:
Search.vuecomponent<search />that renders the pagefind search modal.Heres how the modal currently looks vs Algolia's (CS2103 site)
Current implementation of pagefind.

Algolia's styling on CS2103 website

From the 2 images above, I believe that Algolia's styling is notably more structured in how it represents the search results and subresults, notably on how they group the search results.
The blog we used as reference for the styling formats the pagefindresults by processing the search results. More information on how to access the specific search results information can be found here.
pagefindconfiguration options withinsite.jsonto enable more flexible filtering options. Users can declareexclude_selectorsoption to exclude specific elements from being searchable.globoption to limit which pages are indexed by Pagefind.{ "pagefind": { "exclude_selectors": [".algolia-no-index", "[class*='algolia-no-index']"] "glob": ["**/devGuide/**", "**/userGuide/**"] } }exclude_selectors: tells Pagefind to exclude any element with thealgolia-no-indexclass from the searchable results. It works the same way as declaringdata-pagefind-ignore.glob: Pagefind will only index pages that are found insidedevGuideanduserGuidedirectories (including subdirectories).All in all, theres still a lot more things we can do to improve this pagefind feature (like page weighting, ranking, sorting etc). But this is all I've managed to conjure up thus far.
Let me know what yall think of these updates to the pagefind feature (there might be better ways to filter pages, this is just from my interpretation when reading through the pagefind docs). Let me know if I missed out on anything in particular or should be focusing my efforts more towards.
Testing instructions:
Proposed commit message: (wrap lines at 72 characters)
Add base Pagefind with updated UI & extra filtering functionalities
Checklist: ☑️
Reviewer checklist:
Indicate the SEMVER impact of the PR:
At the end of the review, please label the PR with the appropriate label:
r.Major,r.Minor,r.Patch.Breaking change release note preparation (if applicable):