-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
client-redirects plugin should not be baseUrl sensitive #2982
Comments
slorber
added
bug
An error in the Docusaurus core causing instability or issues with its execution
status: needs triage
This issue has not been triaged by maintainers
mlh
Major League Hacking Fellowship
v2
and removed
status: needs triage
This issue has not been triaged by maintainers
labels
Jun 23, 2020
This was referenced Jun 23, 2020
I observed two related issues while reproducing this issue.
To resolve this, we can add a slash at the end. i.e.
// append an ending slash to all array elements like this
const allDocHomesPaths = [
'/docs/',
'/docs/next/',
...versions.slice(1).map((version) => `/docs/${version}/`),
]; I will make a PR to resolve the website redirection issue in point 2 together with the original issue for now |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🐛 Bug Report
Discussed here:
#2969 (comment)
Have you read the Contributing Guidelines on issues?
Yes
To Reproduce
baseUrl: '/build'
"serve:v2": "serve website",
/docs/versionX/introduction
to/docs/versionX/
that the plugin setup should work like it does without a baseUrl (http://localhost:5000/build/docs/introduction)The conf is currently:
Expected behavior
Using a baseUrl should not require the user to reconfigure the plugin
Here we need to modify the behavior of
createRedirects
, becase the path argument includes the baseUrl.For the extensions it has been fixed in #2969
Actual Behavior
createRedirects
is baseUrl sensitiveWhat we should probably do?
The postBuild hook receives props.routePaths, but these paths includes the baseUrl, and we forward these paths to other plugin methods:
We should probably instead make these paths relative to the baseUrl so that the plugin config is not baseUrl sensitive.
(this probably requires reverting some changes from #2969 , as passing the baseUrl as arg to some methods would not be needed anymore)
The text was updated successfully, but these errors were encountered: