Links with absolute urls do not work
manvydasu opened this issue · comments
Hello,
Context
Currently, its impossible to add an absolute url link, which would redirect user from stoplight elements page, to a differente page , which is located outside of stoplight elements scope
Steps to Reproduce
- Have @stoplight/elements generated API be placed under specific route, i.e. my-domain.com/api#.
- Use hash router.
- Have some pages outside of the @stoplight/elements scope, i.e. my-domain.com/guides
- Attempt to add a link in API documentation, which would direct user to guides page, i.e. [check out our guides page](/guides)
Current Behavior
The generated links poins to my-domain.com/api#/guides
instead of my-domain.com/guides
Expected Behavior
I would expect a valid link to be genrated, which would point to my-domain.com/guides
.
Possible Workaround/Solution
No workarounds, unless final host url is known in advance.
- Version used: Latest @stoplight/elements version
@manvydasu We propose the following enhancement to achieve what you're after:
- pick some sort of token to use in the link definition to tell us to put the host in the url (i.e.
[check out our guides page]($$origin/guides)
- when we come across this token, we'd replace it with the origin where the app is currently hosted
We will work with our Product team to prioritize this, but feel free to put up a PR for the proposed solution above in the meantime.