Skip to content
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

Links with absolute urls do not work #2469

Open
manvydasu opened this issue Dec 11, 2023 · 1 comment
Open

Links with absolute urls do not work #2469

manvydasu opened this issue Dec 11, 2023 · 1 comment
Labels

Comments

@manvydasu
Copy link

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

  1. Have @stoplight/elements generated API be placed under specific route, i.e. my-domain.com/api#.
  2. Use hash router.
  3. Have some pages outside of the @stoplight/elements scope, i.e. my-domain.com/guides
  4. 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
@chohmann
Copy link
Contributor

@manvydasu We propose the following enhancement to achieve what you're after:

  1. 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)
  2. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants