-
-
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
Validation of footer href
values does not allow URI references (e.g. /foo/bar
)
#3221
Comments
Helpful infos summary:
The netlify redirect: As it's not really affecting you deeply, I'm going to close and see if this problem comes up again. As a workaround, you can normally get the deployment URL as an env variable, so that you use the redirect fo the current deployment: const siteDomain = process.env.DEPLOY_URL
? process.env.DEPLOY_URL
: "https://zmkfirmware.dev";
const footerLink = {
label: "Discord",
href: siteDomain + "/community/discord/invite"
}; see https://docs.netlify.com/configure-builds/environment-variables/#deploy-urls-and-metadata |
@slorber Thanks for the quick follow up. The only downside to using I can use Agreed this is a niche issue, but still something that seems worth thinking about supporting somehow in Docusaurus. Thanks again for the great project. |
Thanks Not sure but maybe DEPLOY_PRIME_URL is a good fit? We could have an escape hatch like |
@petejohanson I think your issue may be the same as mine - configuring links to relative external pages via Would #3449 fix this issue for you? |
@tommilligan Sure seems like that would address the issue I had to work around, yes. |
🐛 Bug Report
Upgrading from 2.0.0-alpha.55 to 2.0.0-alpha.61 of all my docusaurus packages has resulted in a validation failure in a working
docusaurus.config.js
file. In particular, In our project, I am deploying to Netlify, and using anetlify.toml
file to add a redirect/community/discord/join
URL that will redirect to the current Discord invite link.In my footer, I've been using an item like:
So that clicking that link in the footer will redirect the browser to that URL on the current host/origin server, which then redirects to the actual Discord link.
After updating all my NPM packages, I get an error when starting Docusaurus:
I can't use
to
instead ofhref
, because that will only redirect with the JS router, not cause a browser navigation, so that just 404s in JS land.Workaround
I can hardcode the full production deployment URL for this one footer link. It's not a huge problem. But doing so definitely seems "wrong", and I would expect to be able to use a URI-reference for this field, not just a URI.
Have you read the Contributing Guidelines on issues?
Yup!
To Reproduce
(Write your steps here:)
/foo/bar
npm start
Expected behavior
A footer link will be added that performs a browser navigation to the given relative URI when clicked.
Actual Behavior
I can't run/build docusaurus.
Your Environment
Reproducible Demo
zmkfirmware/zmk
docs
directory.npm ci
npm start
and confirm it loads and footer link with labeled "Discord" and confirm it works.npm update
to pull in latest Docusaurus NPM packages.npm start
The text was updated successfully, but these errors were encountered: