photoprism-docs icon indicating copy to clipboard operation
photoprism-docs copied to clipboard

Mkdocs: Links without trailing `/` can break sidebar navigation

Open strugee opened this issue 1 year ago • 7 comments

STR:

  1. Visit https://github.com/photoprism/photoprism/blob/e7370838221c373a23dc9a09f186a6065e2a5162/CONTRIBUTING.md#submitting-pull-requests
  2. Click the "step-by-step guide" link, which goes to https://docs.photoprism.app/developer-guide/pull-requests
  3. Click AFAICT basically anything in the sidebar (I clicked "Build setup")
  4. 404 Not Found

Adding a / to the URL - e.g. https://docs.photoprism.app/developer-guide/pull-requests/ - makes the sidebar function as intended.

strugee avatar Sep 18 '23 02:09 strugee

Maybe that's something that must be fixed in mkdocs material then?

Edit: I've asked for advice in their private support chat. Maybe this can be solved with a config option. The site is hosed on a CDN, so we don't directly control the web server config.

lastzero avatar Sep 18 '23 08:09 lastzero

It seems that this needs to be fixed on the server side or in the CDN config. So I'll have to postpone finding a solution until I have time for doing this.

lastzero avatar Sep 18 '23 13:09 lastzero

Another option is to do it the quick and dirty way and add a bit of JavaScript to fix up the URL. Doing it server side is better though since that obviously won't work for anyone with JavaScript disabled.

strugee avatar Sep 18 '23 16:09 strugee

I've tested this again and the problem seems to be fixed with the latest version of MkDocs Material, which we use to render our docs from Markdown files. Shall we close this issue then?

lastzero avatar May 09 '24 09:05 lastzero

Hmm. I can still reproduce using the STR from the description?

strugee avatar May 09 '24 15:05 strugee

You're right, my bad. Didn't properly follow the steps!

lastzero avatar May 09 '24 15:05 lastzero

No problem!

strugee avatar May 09 '24 15:05 strugee