-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
content plugins reject options.routeBasePath = '' #8254
Comments
Hey Somehow it's done on purpose because previously it lead to issues, although now with #3427 it shouldn't be an issue anymore. We could either:
Considering we have related validation for baseUrl (#8066) I guess we should do the same here, and apply this to all 3 content plugins: docs, pages, blog. To make things more predictable I'd prefer if we apply the same logic as baseUrl and always normalize this URL segment to have leading/trailing slashes. Cf #8066 for implementation baseUrl: Joi.string()
.required()
.custom((value: string) => addLeadingSlash(addTrailingSlash(value))), Any opinion @Josh-Cena ? Good issue for an external contributor looking to contribute. Send directly the PR only if you can handle it. Do not claim it, we won't assign it to you unless there's a PR first. |
could you check my PR? i reflect your opinion
|
Frankly I don't get the semantic difference between |
I agree with your opinion, but here, even when routeBasePath is not defined, the root (/) path is entered by default. I'm not quite sure what the difference is with "" in this case. |
I don't even remember what this issue is exactly but I don't think it hacks around anything if we normalize '' to '/' anyway.
'/' works so if we normalize '' to '/' there won't be issues, it would work as if user provided "/" 🤷♂️
To me using "docs" (default plugin routeBasePath value) instead of "/docs/" is not particularly more semantically wrong than using '' instead of '/'.
Now I didn't notice but we actually don't accept
I suggest either:
The first option looks better to me, as users will intuitively try to use ''. Do we want to throw on start while we could handle the bad value more gracefully? Heck, we could even accept null/false here 🤷♂️ |
If the progress is stopped, how about we discuss it again?
how about think that @Josh-Cena ? |
Yeah, I'll agree with that stance. Well, I'll prefer to normalize—I know it was previously used as a "multiple root plugins" hack, which is why I don't like |
is it happen in this repository? if some of case is exist. i want to know more. because i didn't hear vulnerabilities. i readed docusaurus routing
i think it can be used "" because it works in root("/") |
…y string, normalized as "/" (#8258) Co-authored-by: sebastienlorber <[email protected]> fix #8254
Have you read the Contributing Guidelines on issues?
Description
When I use default preset options
It pointed out that
ValidationError: "routeBasePath" is not allowed to be empty
Self-service
The text was updated successfully, but these errors were encountered: