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.
Motivation
I have a big write-up on Stack Overflow about what I'm trying to do: https://stackoverflow.com/questions/63268853/how-do-i-link-to-non-docusaurus-defined-routes-from-a-docusuarus-footer
The TL;DR is that my Docusaurus docs are compiled and static files are saved to a /docs directory of my webserver, but the rest of my site is developed outside of Docusaurus. I'd like to link to local resources like /contact-us or /about-us from my Docusaurus footer, but
/about-us
is currently an "invalid"href
value, and if I try to use theto: '/about-us'
syntax, the React router tries to snag my click.This change allows for such local links by adding the
allowRelative
flag to the URI validator. https://github.com/sideway/joi/blob/master/API.md#stringurioptionsHave you read the Contributing Guidelines on pull requests?
Yes
Test Plan
I verified that I could add a footer link of the form:
and the config validator didn't complain, and the react router didn't try to snag my click.
Related PRs
(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)