feat(search): Algolia search via modal widget#31
Merged
Conversation
✅ Deploy Preview for powershellorg ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Integrate Algolia's Netlify crawler frontend. A magnifying-glass icon in the header (desktop) and a Search item in the mobile menu open a modal dialog hosting the Algolia autocomplete widget, giving a roomy, site-wide search experience. - Add params.algolia (appId, search-only apiKey, siteId, branch) to hugo.yaml - New partials: search.html (widget init) and search-modal.html (Alpine modal) - Load widget CSS and mount the modal + init in baseof.html; add [x-cloak] rule - Replace the per-section client-side filters on the articles, podcast, and author list views (they only matched the current page) with the global modal Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
b6805ec to
9db74f4
Compare
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
Adds on-site search powered by Algolia's Netlify Crawler integration. The crawler backend is already configured in the Netlify dashboard (indexes the
maindeploy); this PR is the frontend.A magnifying-glass icon in the header (desktop) and a Search item in the mobile menu open a modal dialog hosting the Algolia autocomplete widget — a roomy, site-wide search surface that makes browsing results easier.
Changes
hugo.yaml— addparams.algolia(appId, search-only apiKey, siteId, branch). The key is search-only and safe to commit.partials/search.html(new) — loads the widget JS and callsalgoliasearchNetlify({...}), targetingdiv.ps-search. Params templated via Go's contextual escaping (nojsonify— that double-encodes inside<script>).partials/search-modal.html(new) — Alpine.js modal (reuses the already-loaded Alpine) containing thediv.ps-searchbox; opens on anopen-searchwindow event, closes on backdrop click / Escape._default/baseof.html— widget CSS in<head>, mounts the modal + init partials, adds an[x-cloak]rule.partials/header.html— desktop icon and mobile menu item dispatchopen-search._default/list.html,podcast/list.html,_default/authors.html) — removed the per-section client-side filters. They only matched items on the current paginated page; the global modal replaces them.Verification
hugo --minifybuilds clean (exit 0; only pre-existing deprecation warnings).div.ps-search(in the modal) on every page type, init script present, triggers wired, no stale inline boxes.hugo servertoo.🤖 Generated with Claude Code