typedoc icon indicating copy to clipboard operation
typedoc copied to clipboard

Make URL separator configurable

Open johh opened this issue 2 years ago • 1 comments

Search Terms

URL, link, file name, separator, dot

Problem

Some hosting services (Cloudflare Pages in particular) seem to have a problem with HTML files containing dots other than the file extension in the file name. CF apparently treats any URL containing a dot as a specific file. This collides with their URL rewriting, which causes URLs ending in .html to be redirected to their extensionless version. Normally this works, but if theres a dot still remaining in the URL, CF will proceed to 404, since it can't find that file.

The request /classes/mymodule.MyClass.html is redirected to /classes/mymodule.MyClass which 404s since the file mymodule.MyClass does not exist.

Suggested Solution

While this is quite obviously a misconfiguration on CFs part, being able to specify a separator manually would mitigate this. Afaik, this isn't trivially solvable with a plugin, since getUrl on the default theme is a static method. Please correct me if I'm wrong.

Maybe I'm missing a really obvious way to work around this – your help would be much appreciated!

johh avatar Apr 11 '22 13:04 johh

Wow, yeah that's annoying... this could be done by a plugin today by providing a custom theme that just overrode the buildUrls method, but that's still not ideal. I've wanted to refactor that part of the code to delegate to a separate router that could be configured independently from the theme for a while. This might be the necessary push for it to actually happen...

Gerrit0 avatar Apr 11 '22 13:04 Gerrit0

Closing in favor of #2111.

Gerrit0 avatar Jan 07 '23 18:01 Gerrit0