feat(website): improve search by filtering JS API docs and release notes#10764
Draft
timotheeguerin wants to merge 1 commit into
Draft
feat(website): improve search by filtering JS API docs and release notes#10764timotheeguerin wants to merge 1 commit into
timotheeguerin wants to merge 1 commit into
Conversation
- Add data-docsearch-ignore to sidebar to prevent crawler from indexing sidebar labels into search result titles (fixes long concatenated titles) - Filter out JS API and release notes from default search results using transformItems client-side filtering - Add $ prefix support to search all content including JS API and release notes - Add Head.astro override to inject docsearch:tag meta for future server-side filtering - Update search placeholder to hint at $ prefix
Contributor
|
No changes needing a change description found. |
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.
Problem
The website search (Algolia DocSearch) returns excessive noise:
Changes
1. Fix long concatenated titles
data-docsearch-ignoreto the sidebar component so the crawler skips it when building the search index2. Filter JS API & release notes from default search
transformSearchClient+transformItemsto filter results whose URL contains/reference/js-api/or/release-notes/$prefix (e.g.,$tagMetadata) to search all content including JS API and release notesSearch… ($ for all)3. Prepare for server-side filtering (future)
Head.astrooverride that injects<meta name="docsearch:tag" content="docs|js-api|release-notes">based on page frontmattertagFiltersfor more efficient filteringTesting
tagMetadata→ should show only decorator/guide docs$tagMetadata→ should show all results including JS API and release notes<meta name="docsearch:tag">is present