feat(plugin-client-redirects): keep the query string + hash (#8227)

Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com>
This commit is contained in:
Xabier Lahuerta Vazquez 2022-10-20 18:01:18 +02:00 committed by GitHub
parent 7b3ebb7729
commit 5ddcbf47a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 23 deletions

View file

@ -39,12 +39,6 @@ function getNextVersionName() {
*/
}
const allDocHomesPaths = [
'/docs/',
'/docs/next/',
...versions.slice(1).map((version) => `/docs/${version}/`),
];
const isDev = process.env.NODE_ENV === 'development';
const isDeployPreview =
@ -187,9 +181,8 @@ const config = {
({
fromExtensions: ['html'],
createRedirects(routePath) {
// Redirect to /docs from /docs/introduction, as introduction has been
// made the home doc
if (allDocHomesPaths.includes(routePath)) {
// Redirect to /docs from /docs/introduction (now docs root doc)
if (routePath === '/docs' || routePath === '/docs/') {
return [`${routePath}/introduction`];
}
return [];