[docs] Redirect old urls to /material/*
when search
#30286
Merged
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.
This PR cover all scenarios when searching with cmd+K (algolia search):
Before migration
The feature toggle is not turned on, so the behavior is still the same.
Migration phase
When the contents are duplicated to
docs/pages/material/*
and the feature toggle is turned on, all the search results (related to components, API, etc.) are replaced to point to/material/*
URL.Post migration
The search config on the doc search is updated and the new
/material/*
have been indexed, the URL will not be replaced because of the regex in the code.✅ E2E website added.