Skip to content

Develop#277

Merged
markdumay merged 2 commits into
mainfrom
develop
May 25, 2026
Merged

Develop#277
markdumay merged 2 commits into
mainfrom
develop

Conversation

@markdumay
Copy link
Copy Markdown
Contributor

Summary

Releases flexsearch.lazyLoad — a new opt-in option that emits the FlexSearch index as a separate per-language JSON file via the searchindex Hugo 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

Test plan

  • exampleSite builds with --gc --minify (pre-commit hook + standalone).
  • Lazy mode (exampleSite default): flexsearch-index.json published as valid JSON; bundle has no inline index.add( data; data-search-index wired onto both search inputs.
  • Eager regression (lazyLoad = false): inline index.add statements restored; no JSON file emitted.
  • End-to-end at 542-page scale (vendored mod-flexsearch patched into infusal/portal + lazyLoad enabled): production hugo --gc build succeeds, core bundle 6.45 MB → 149 KB, flexsearch-index.json valid (539 docs), no CSP violation.

🤖 Generated with Claude Code

markdumay and others added 2 commits May 24, 2026 17:33
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>
@markdumay markdumay enabled auto-merge May 25, 2026 05:17
@markdumay markdumay merged commit 0ae4727 into main May 25, 2026
8 checks passed
@markdumay
Copy link
Copy Markdown
Contributor Author

🎉 This PR is included in version 4.3.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant