perf: Defer the search UI, whole-card results, cleaner index - #904
Open
lfrancke wants to merge 2 commits into
Open
perf: Defer the search UI, whole-card results, cleaner index#904lfrancke wants to merge 2 commits into
lfrancke wants to merge 2 commits into
Conversation
The pagefind js and css were the last render-blocking requests in the head of every page; they now load when the search popover first opens (button, Ctrl+K), keeping search behaviour identical from the second keystroke of a visit onwards. The result template used to wrap only the title in a link while pagefind's stylesheet gave the whole card a pointer cursor; the card is one block-level link now, with hover and focus-visible styling, and the keyboard navigation follows the flatter markup.
Both render inside the article element and were indexed with the page content, polluting excerpts with navigation labels and banner text.
✅ Deploy Preview for stackable-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
lfrancke
commented
Jul 28, 2026
| // Loads the pagefind search UI on first use (see 07-search.js); the | ||
| // assets stay off the critical rendering path of every page. | ||
| // Some styling is customized, these classes are found in search.css. | ||
| window.addEventListener('DOMContentLoaded', (event) => { |
Member
Author
There was a problem hiding this comment.
This looks worse than it is: It really is just different indentation mostly
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.
Description
This changes three things with the search:
Another Google PageSpeed finding: The pagefind stuff was loaded on every page (~450ms render-blocking), now it's only loaded the first time you click on the search icon thing
The thing that has annoyed me for years: The whole result card is now clickable and not only the title anymore
Index hygiene: Added
data-pagefind-ignoreattributes to the pagination nav and the EoL-bannerVerification
Look at the preview...search something. Easy as that.