Skip to content

feat(site): migrate search from Pagefind to Algolia DocSearch v4#941

Merged
decepulis merged 7 commits intomainfrom
feat/algolia
Mar 20, 2026
Merged

feat(site): migrate search from Pagefind to Algolia DocSearch v4#941
decepulis merged 7 commits intomainfrom
feat/algolia

Conversation

@decepulis
Copy link
Copy Markdown
Collaborator

@decepulis decepulis commented Mar 13, 2026

Summary

  • Replaces Pagefind (build-time static search) with Algolia DocSearch v4
  • Two search indexes: videojs_docs (relevance-ranked, framework-filtered) and videojs_blog (recency-ranked)
  • Crawler configuration managed in the Algolia Dashboard

What's included

  • Remove Pagefind integration (integrations/pagefind.ts), dependencies (@pagefind/default-ui, sirv), and all data-pagefind-* attributes
  • Add @docsearch/css@4 and @docsearch/react@4 with indices prop for multi-index search
  • New data-search-content / data-search-ignore attributes for crawler content targeting
  • src/components/Search.tsx — React component loaded via client:load in both NavBars
  • src/search.config.ts — Algolia app ID, public API key, and index names
  • src/styles/docsearch.css — DocSearch modal themed to match site design (light + dark)
  • Updated CLAUDE.md and README.md

Before merging

  • Run full crawl from the Algolia Dashboard
  • Verify DocSearch button appears in navbar (after deploy)
  • Verify Cmd+K opens search modal
  • Verify dark mode theming

Test plan

  • pnpm -F site build passes
  • No pagefind references remain in site/ source
  • data-llms-* attributes unaffected

Closes #938

🤖 Generated with Claude Code

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
v10-sandbox Ready Ready Preview, Comment Mar 20, 2026 3:20pm

Request Review

@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 13, 2026

Deploy Preview for vjs10-site ready!

Name Link
🔨 Latest commit 51a67a3
🔍 Latest deploy log https://app.netlify.com/projects/vjs10-site/deploys/69bd65c0c53a850008bcbc72
😎 Deploy Preview https://deploy-preview-941--vjs10-site.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 13, 2026

📦 Bundle Size Report

🎨 @videojs/html — no changes
Presets (7)
Entry Size
/video (default) 23.22 kB
/video (default + hls) 153.63 kB
/video (minimal) 23.05 kB
/video (minimal + hls) 153.68 kB
/audio (default) 21.46 kB
/audio (minimal) 21.44 kB
/background 6.38 kB
Media (5)
Entry Size
/media/background-video 1.03 kB
/media/container 1.59 kB
/media/dash-video 236.04 kB
/media/hls-video 131.57 kB
/media/simple-hls-video 12.33 kB
Players (3)
Entry Size
/video/player 6.24 kB
/audio/player 6.23 kB
/background/player 6.22 kB
Skins (16)
Entry Type Size
/video/minimal-skin.css css 3.12 kB
/video/skin.css css 3.15 kB
/video/minimal-skin js 22.25 kB
/video/minimal-skin.tailwind js 22.50 kB
/video/skin js 22.42 kB
/video/skin.tailwind js 22.76 kB
/audio/minimal-skin.css css 2.28 kB
/audio/skin.css css 2.30 kB
/audio/minimal-skin js 20.66 kB
/audio/minimal-skin.tailwind js 20.70 kB
/audio/skin js 20.68 kB
/audio/skin.tailwind js 20.94 kB
/background/skin.css css 117 B
/background/skin js 1003 B
/base.css css 157 B
/shared.css css 86 B
UI Components (21)
Entry Size
/ui/alert-dialog 2.08 kB
/ui/alert-dialog-close 1.63 kB
/ui/alert-dialog-description 1.52 kB
/ui/alert-dialog-title 1.55 kB
/ui/buffering-indicator 1.78 kB
/ui/captions-button 1.79 kB
/ui/controls 1.59 kB
/ui/fullscreen-button 1.81 kB
/ui/mute-button 1.78 kB
/ui/pip-button 1.80 kB
/ui/play-button 1.82 kB
/ui/playback-rate-button 1.81 kB
/ui/popover 3.27 kB
/ui/poster 1.75 kB
/ui/seek-button 1.80 kB
/ui/slider 2.02 kB
/ui/thumbnail 2.12 kB
/ui/time 1.68 kB
/ui/time-slider 2.12 kB
/ui/tooltip 2.40 kB
/ui/volume-slider 2.26 kB

Sizes are marginal over the root entry point.

⚛️ @videojs/react — no changes
Presets (7)
Entry Size
/video (default) 18.98 kB
/video (default + hls) 149.76 kB
/video (minimal) 19.03 kB
/video (minimal + hls) 149.71 kB
/audio (default) 14.93 kB
/audio (minimal) 15.05 kB
/background 3.13 kB
Media (4)
Entry Size
/media/background-video 476 B
/media/dash-video 236.19 kB
/media/hls-video 131.59 kB
/media/simple-hls-video 12.34 kB
Skins (14)
Entry Type Size
/video/minimal-skin.css css 3.12 kB
/video/skin.css css 3.15 kB
/video/minimal-skin js 18.93 kB
/video/minimal-skin.tailwind js 22.12 kB
/video/skin js 18.94 kB
/video/skin.tailwind js 22.10 kB
/audio/minimal-skin.css css 2.28 kB
/audio/skin.css css 2.30 kB
/audio/minimal-skin js 14.94 kB
/audio/minimal-skin.tailwind js 17.02 kB
/audio/skin js 14.88 kB
/audio/skin.tailwind js 17.26 kB
/background/skin.css css 90 B
/background/skin js 272 B
UI Components (18)
Entry Size
/ui/alert-dialog 2.24 kB
/ui/buffering-indicator 2.21 kB
/ui/captions-button 2.25 kB
/ui/controls 2.24 kB
/ui/fullscreen-button 2.27 kB
/ui/mute-button 2.26 kB
/ui/pip-button 2.27 kB
/ui/play-button 2.24 kB
/ui/playback-rate-button 2.27 kB
/ui/popover 2.87 kB
/ui/poster 2.08 kB
/ui/seek-button 2.27 kB
/ui/slider 3.17 kB
/ui/thumbnail 2.01 kB
/ui/time 1.93 kB
/ui/time-slider 2.65 kB
/ui/tooltip 2.69 kB
/ui/volume-slider 2.68 kB

Sizes are marginal over the root entry point.

🧩 @videojs/core — no changes
Entries (6)
Entry Size
. 4.81 kB
/dom 8.41 kB
/dom/media/custom-media-element 1.81 kB
/dom/media/dash 235.62 kB
/dom/media/hls 131.27 kB
/dom/media/simple-hls 11.85 kB
🏷️ @videojs/element — no changes
Entries (2)
Entry Size
. 999 B
/context 943 B
📦 @videojs/store — no changes
Entries (3)
Entry Size
. 1.32 kB
/html 700 B
/react 360 B
🔧 @videojs/utils — no changes
Entries (10)
Entry Size
/array 104 B
/dom 1.25 kB
/events 227 B
/function 261 B
/object 119 B
/predicate 265 B
/string 148 B
/style 190 B
/time 478 B
/number 158 B
📦 @videojs/spf — no changes
Entries (3)
Entry Size
. 40 B
/dom 10.04 kB
/playback-engine 9.94 kB

ℹ️ How to interpret

All sizes are standalone totals (minified + brotli).

Icon Meaning
No change
🔺 Increased ≤ 10%
🔴 Increased > 10%
🔽 Decreased
🆕 New (no baseline)

Run pnpm size locally to check current sizes.

- Replace Pagefind integration with Algolia DocSearch v4
- Add two search indices (docs + blog) with framework faceting
- Add Ask AI assistant backed by markdown index
- Theme DocSearch modal and trigger to match site design system
- Add pre-hydration placeholder button for client:idle loading
- Add data-search-ignore to Tab layout-stability span
- Add getMissingResultsUrl for missing results feedback

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove stale references to Ask AI, algolia-crawler-config.md, and
old Search/ directory structure. Fix component paths and remove dead
.DocSearch-Hit--AskAI CSS selector.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
decepulis and others added 2 commits March 20, 2026 09:38
Move @docsearch/css import from JS (Search.tsx) into docsearch.css with
layer(base) to ensure deterministic load order and correct cascade
priority with Tailwind utilities.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@decepulis decepulis marked this pull request as ready for review March 20, 2026 14:56
Copilot AI review requested due to automatic review settings March 20, 2026 14:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Migrates the site’s search implementation from Pagefind (build-time static indexing) to Algolia DocSearch v4 (hosted indexes queried at runtime), including updated crawler-targeting attributes and theming.

Changes:

  • Replaced Pagefind UI/integration with a DocSearch React component wired for multi-index search (docs + blog) and framework facet filtering.
  • Removed Pagefind-specific build/dev integration and dependencies; updated pages/components to use data-search-content / data-search-ignore.
  • Added DocSearch theming CSS and documented the new search setup in project docs.

Reviewed changes

Copilot reviewed 18 out of 20 changed files in this pull request and generated no comments.

Show a summary per file
File Description
site/src/styles/globals.css Imports new DocSearch theme overrides globally.
site/src/styles/docsearch.css Adds DocSearch v4 base CSS import + site-specific light/dark theming and component styling.
site/src/search.config.ts Centralizes Algolia app/key and index names used by the DocSearch component.
site/src/pages/docs/framework/[framework]/[...slug].astro Swaps Pagefind indexing/filter attributes for Algolia crawler attributes on docs content.
site/src/pages/blog/[...slug].astro Swaps Pagefind indexing/sort/meta attributes for Algolia crawler attributes on blog content.
site/src/components/docs/FrameworkCase.astro Updates ignore attribute from Pagefind to the new crawler ignore marker.
site/src/components/Tabs.tsx Ensures hidden layout-stabilizing text isn’t indexed by the crawler/LLM export.
site/src/components/Search.tsx New DocSearch v4 React search component (multi-index + framework facet filter).
site/src/components/NavBar/NavBar.astro Loads the new React search component via client:load in the main navbar.
site/src/components/NavBar/NavBarDocs.astro Loads the new React search component via client:load in the docs navbar.
site/package.json Removes Pagefind deps; adds @docsearch/react and @docsearch/css.
site/astro.config.mjs Removes the Pagefind Astro integration from the build pipeline.
site/integrations/pagefind.ts Deletes the Pagefind integration implementation.
site/README.md Updates repo documentation to reflect the new Algolia-based search approach.
site/CLAUDE.md Updates internal documentation to reflect DocSearch v4 and crawler attributes.
pnpm-lock.yaml Locks dependency graph updates for the DocSearch packages and removals.
site/src/components/Search/* (deleted) Removes the old Pagefind-based Search implementation/assets.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Use fixed widths instead of min-width so the button size matches the
displayed shortcut key — wider for "Ctrl K" (non-Apple) than "⌘K".

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@decepulis decepulis merged commit 9ef1e61 into main Mar 20, 2026
20 checks passed
@decepulis decepulis deleted the feat/algolia branch March 20, 2026 15:25
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.

Migrate site search from Pagefind to Algolia DocSearch v4

2 participants