Appending `/~explorer` to a relative URL causes base URL directory to be ignored
How urgent is this?
P0 - Critical (Blocking work)
What's the issue?
Steps to reproduce:
- Set up docs.yml to have the docs root directory be a subdirectory of the server (i.e.
fern.docs.buildwithfern.com/learn - Create a <Card> component with a relative href pointing at the API explorer for a given endpoint:
<Card
title="API Explorer"
icon="fa-regular fa-telescope"
href="/api-reference/tokens/generate/~explorer"
>
Explore the API from the comfort of your browser.
</Card>
- Publish the site (or run
fern docs dev) and notice that thehrefproperty of the link for the card does not include the docs root subdirectory.
Expected: <a href="/learn/api-reference/tokens/generate/~explorer">...</a>
Actual: <a href="/api-reference/tokens/generate/~explorer">...</a>
Fern CLI & Generator Versions
Fern CLI version 0.57.16
This might actually have been an error on my part—are all hrefs supposed to include the path from the hostname to the Fern site root (i.e. /learn in my example)? In other words, is the href property in my example actually supposed to be /learn/api-reference/tokens/generate/~explorer?
If so this might just be an area for improvement in the docs about links and what the link href path should be relative to. Not including the /learn part was working for me, but it was also causing problems with fern check --broken-links, which made me wonder if it wasn't correct.
Separately it'd be wonderful for fern check --broken-links to handle the ~explore url suffix on API references!
Closing this issue, since the link format for the API Explorer has now changed.