Conversation
When enabled via params.modules.flexsearch.lazyLoad, the FlexSearch index data is emitted as a separate per-language JSON file through a new searchindex Hugo output format and fetched on the visitor's first search interaction, instead of being bundled into the core script loaded on every page. Cuts the core bundle by several megabytes on content-heavy sites at the cost of a single fetch on first search. The searchindex output format must be attached to home outputs at the theme level — Hinode includes this wiring from the next release. Sites with a strict Content Security Policy must allow connect-src 'self'; the module declares this in its csp block so mod-csp picks it up automatically. The eager and lazy paths share a single source of truth for index documents (layouts/_partials/utilities/GetSearchDocs.html), so both behave identically with respect to the existing summaryOnly, frontmatter, filter, and canonifyURLs options. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Contributor
Author
|
🎉 This PR is included in version 4.3.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
Summary
Releases
flexsearch.lazyLoad— a new opt-in option that emits the FlexSearch index as a separate per-language JSON file via thesearchindexHugo output format and fetches it on the visitor's first search interaction, instead of bundling the index into the core script loaded on every page.Single commit ahead of v4.2.0: caaa1fb (
feat: add lazyLoad option to fetch the search index on demand). semantic-release will cut v4.3.0.On a 542-page test site the core JS bundle shrank from 6.45 MB → 149 KB.
Coordination
searchindexoutput format definition +[outputs]entry) — see gethinode/hinode@98160ea + gethinode/hinode@c624d12.lazyLoad = false— non-breaking. Flipping the default in a future major: mod-flexsearch: default lazyLoad to true in a future major release hinode#1934.export()/import(): mod-flexsearch: ship a serialized FlexSearch index (export/import) for faster lazy load hinode#1933.Test plan
--gc --minify(pre-commit hook + standalone).flexsearch-index.jsonpublished as valid JSON; bundle has no inlineindex.add(data;data-search-indexwired onto both search inputs.lazyLoad = false): inlineindex.addstatements restored; no JSON file emitted.hugo --gcbuild succeeds, core bundle 6.45 MB → 149 KB,flexsearch-index.jsonvalid (539 docs), no CSP violation.🤖 Generated with Claude Code