gristlabs / mkdocs-windmill

Outstanding mkdocs theme with a focus on navigation and usability
Other
106 stars 62 forks source link

Fixed 404 page #60

Closed Spencer-Sawyer closed 2 years ago

Spencer-Sawyer commented 2 years ago

The 404 page had broken links due to base_url being a "/"

dsagal commented 2 years ago

This change isn't specific to 404 pages, right? It seems to replace base_url of / with . for all uses.

Is the idea that setting base_url to / is generally wrong, so why not just correct it automatically to ., which is more likely to be right? In my usage, I don't use base_url, so it defaults to . already. But I wonder if there are cases when people set it to / intentionally.

Spencer-Sawyer commented 2 years ago

I believe mkdocs is serving base_url as "" when passing root docs through the templating phase which means it was defaulting to "." but when extending static templates, like 404.html it serves base_url as /. base_url is used in subdirectories to prepend .. (or ../../../etc) to get back to the root directory.

I did note that even in the static webpage for this repo, the 404 was broken.