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
Escaping from SPA redirects without the base-url added #9047
Comments
cc @slorber for opinions |
I don't think we support that using the Not sure how we could extend that proprietary protocol to support your use-case, maybe a query string? 🤷♂️
You can create a small remark plugin that will replace links with Note: it's often preferable to build once per domain (instead of building once for all domains) because the domain URL should rather be in the site metadata anyway (canonical URL, SEO etc...). Another option is to provide your own markdown link React component, enhancing hours with your own logic: https://docusaurus.io/docs/markdown-features/react#mdx-component-scope import React from 'react';
import MDXComponents from '@theme-original/MDXComponents';
import Link from '@docusaurus/Link';
export default {
...MDXComponents,
a: (props) {
return <Link autoAddBaseUrl={props.to !== "pathname:///settings"} {...props} />
}
}; MDX will use your enhanced component instead of the default one, giving you the opportunity to invent your own protocols and proprietary logic if you want to.
|
Thanks for all the details and information !
For our use case, it makes sense to build it only once, since we are not responsible of the domain where the application (bundled with the documentation) will be deployed, and is stored as a container image. We do not really care of SEO since it is for internal use.
Yeah I get it ! Was hopping something build-in ! But based on the strange use-case we have I get they are not simpler solution ! Closing as resolved, thanks @slorber . |
Have you read the Contributing Guidelines on issues?
Prerequisites
npm run clear
oryarn clear
command.rm -rf node_modules yarn.lock package-lock.json
and re-installing packages.Description
I have my documentation at
https://my-domain/documentation/
therefore I configured the baseUrl to '/documentation'. Everything is working well.I want to have a link to one of my resources at
https://my-domain/settings/
however, using theRedirect to
https://my-domain/documentation/settings/
. I cannot hardcode the domain, since the documentation is attached to a deployment that can be, and will put under many different domains.Reproducible demo
No response
Steps to reproduce
Expected behavior
Being able to redirect to any part of the website without the baseUrl
Actual behavior
It is redirecting with the baseUrl
Your environment
Workarround
In a
example.mdx
fileSelf-service
The text was updated successfully, but these errors were encountered: