Add JavaScript-based redirects to supplement Read the Docs redirects #11304
+31
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Read the Docs redirects don't reliably apply when there is a large amount of redirects defined. While this JavaScript-based solution is not as seamless, it has no limit on how many redirects can be defined.
To test this PR, build the website locally and run
simple-http-server --try-file 404.html
in_build/html
. It's important to instruct the local web server to use404.html
as a custom 404 page, or you won't be able to test this.Note that
redirects.csv
isn't modified by this PR yet, so this won't perform all redirects from the previouscontributing
section tocontributing.godotengine.org
.We'll also probably want to change the redirects CSV URL to match the current branch in the long run. I'm not sure how we should do this in a way that keeps working with local web servers (which may not have
/latest
,/stable
or/4.5
in the URL). Maybe we should just modifycustom.js
for each branch?