photoprism / photoprism-docs

Official Documentation (English)
https://docs.photoprism.app
Other
61 stars 108 forks source link

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

Open strugee opened 1 year ago

strugee commented 1 year ago

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.

lastzero commented 1 year ago

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 commented 1 year ago

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.

strugee commented 1 year ago

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.

lastzero commented 6 months ago

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?

strugee commented 6 months ago

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

lastzero commented 6 months ago

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

strugee commented 6 months ago

No problem!