Skip to content

Scope Algolia DocSearch to current docs platform and version#309

Merged
simonhamp merged 1 commit intomainfrom
fix-algolia-search-scope
Mar 29, 2026
Merged

Scope Algolia DocSearch to current docs platform and version#309
simonhamp merged 1 commit intomainfrom
fix-algolia-search-scope

Conversation

@simonhamp
Copy link
Copy Markdown
Member

@simonhamp simonhamp commented Mar 29, 2026

Summary

  • When browsing docs (e.g. /docs/mobile/3/...), Algolia DocSearch results are now filtered to only show pages from the current platform and version using transformItems.
  • Added docsearch:platform and docsearch:version meta tags to docs pages for future Algolia crawler facet support.
  • Fixed Cmd+K opening duplicate DocSearch modals by initializing only one DocSearch instance and cloning the button into the mobile container as a proxy.

Test plan

  • Feature tests for meta tag rendering on mobile, desktop, and non-docs pages
  • Verify Cmd+K opens a single search modal
  • Verify search results on /docs/mobile/3/... only show mobile v3 pages
  • Verify search results on /docs/desktop/2/... only show desktop v2 pages
  • Verify search on non-docs pages (e.g. /) returns all results
  • Verify mobile menu search button still opens the search modal

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@simonhamp simonhamp marked this pull request as ready for review March 29, 2026 14:00
@simonhamp simonhamp merged commit 219c835 into main Mar 29, 2026
2 checks passed
@simonhamp simonhamp deleted the fix-algolia-search-scope branch March 29, 2026 14:01
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.

1 participant