mystmd
mystmd copied to clipboard
RTD: Redirect pages to `.html` files
trafficstars
Description
Navigating a static page seems to be broken when hosted on RTD. The files are there, but the path /quickstart does not automatically translate to /quickstart.html
Workaround
Was hoping that adding symlinks would resolve this issue, but apparently not:
- find $READTHEDOCS_OUTPUT/html -type f -iname "*.html" -exec sh -c "ln -s \$(basename \"\$1\") \$(dirname \"\$1\")/\$(basename \"\$1\" .html)" sh {} \;
So back to the drawing board
Proposed solution
Wish I knew :disappointed:
Related
- #188
- #302
- #982
There might be a solution for RTD using their builtin redirection https://github.com/readthedocs/readthedocs.org/issues/11220. Still I'm not sure if this is an issue to be solved at the generation level or at the hosting level. npx serve indeed seems to redirect all urls appropriately, but how does it do that?