kwilteam / docs

3 stars 5 forks source link

Fix: Relative links broken for CLI #70

Closed KwilLuke closed 5 months ago

KwilLuke commented 6 months ago

When loading a page from a hyperlink, relative links do not work. This is a problem because we use relative links in some places of the docs. This was realized in #69.

We need to update the links to be the absolute paths.

jchappelow commented 6 months ago

I reproduced this a few times, and then I... couldn't.

However, when I could, I noticed that the difference between direct-link/reload vs navigating to the doc with the problem link was that the presence of a trailing / in the URL was the variable. I think this was messing up the relative links, causing it to interpret what ./ meant differently.

Seems like there's something else funny about either our docusaurus and/or deployment. Switching to all absolute paths might be papering over another issue, also kinda unfortunate.

jchappelow commented 6 months ago

Oh wait did you just redeploy and that's why I can't repro all of a sudden? :laughing:

KwilLuke commented 6 months ago

Haha if you are trying to do repro on the bug mentioned in #69, yes I have already redeployed 😂

KwilLuke commented 6 months ago

Yeah, I can reliably reproduce it when I click on a page that I am linked to from another browser. For example, open this page in an incognito window and click the key management guide hyperlink. You should get 404. But if you go to the docs home page and progress your way through the docs to the same link, it does work.

My best guess is that docusarus saves some state in the browser session about how your are navigating that does not get created when you directly link to a page.

In any case, the good news is that we actually don't use relative links in the docs generation tool, so nothing we need to change there. @luisgruson is fixing up the few other places we use relative docs right now.

KwilLuke commented 5 months ago

Closed in #73