Skip to content

feat(search): Algolia search via modal widget#31

Merged
psjamesp merged 1 commit into
mainfrom
feat/algolia-search
Jun 22, 2026
Merged

feat(search): Algolia search via modal widget#31
psjamesp merged 1 commit into
mainfrom
feat/algolia-search

Conversation

@HeyItsGilbert

Copy link
Copy Markdown
Member

Summary

Adds on-site search powered by Algolia's Netlify Crawler integration. The crawler backend is already configured in the Netlify dashboard (indexes the main deploy); 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 — add params.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 calls algoliasearchNetlify({...}), targeting div.ps-search. Params templated via Go's contextual escaping (no jsonify — that double-encodes inside <script>).
  • partials/search-modal.html (new) — Alpine.js modal (reuses the already-loaded Alpine) containing the div.ps-search box; opens on an open-search window 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 dispatch open-search.
  • List views (_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 --minify builds clean (exit 0; only pre-existing deprecation warnings).
  • Confirmed in rendered output: single div.ps-search (in the modal) on every page type, init script present, triggers wired, no stale inline boxes.
  • Manual: open via header icon / mobile menu, type a term (e.g. "plaster"), results dropdown appears and navigates. Since the production index is already populated, search works in local hugo server too.

🤖 Generated with Claude Code

@netlify

netlify Bot commented Jun 21, 2026

Copy link
Copy Markdown

Deploy Preview for powershellorg ready!

Name Link
🔨 Latest commit 9db74f4
🔍 Latest deploy log https://app.netlify.com/projects/powershellorg/deploys/6a3832efe21e550008e87eaf
😎 Deploy Preview https://deploy-preview-31--powershellorg.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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>
@HeyItsGilbert HeyItsGilbert enabled auto-merge (rebase) June 21, 2026 18:53
@psjamesp psjamesp merged commit bbdc751 into main Jun 22, 2026
5 checks passed
@psjamesp psjamesp deleted the feat/algolia-search branch June 22, 2026 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants