mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-22 05:27:00 +02:00
feat(plugin-client-redirects): keep the query string + hash (#8227)
Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com>
This commit is contained in:
parent
7b3ebb7729
commit
5ddcbf47a8
4 changed files with 16 additions and 23 deletions
|
@ -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 [];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue