-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add subpath redirects #232
Conversation
Thanks for your contribution! |
window.location = path.replace(stdlibRegex, "/doc/<#CURRENTVERSIONTAG>/stdlib/"); | ||
} else if (refmanRegex.test(path)) { | ||
const version = path.match(refmanRegex)[1]; | ||
window.location = path.replace(refmanRegex, "/doc/" + version + "/refman/"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The case of distrib/current/refman
will need to be handled specially (using the #CURRENTVERSIONTAG
). BTW, this case also exists for the stdlib doc (as in /distrib/current/stdlib
or /distrib/<version>/stdlib
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The distrib/current/refman is already handled by meta refresh redirect (https://htk-coq-website-fix.github.io/distrib/current/refman)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same goes for /distrib/current/stdlib
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This actually does not handle sub-paths. Here is an example of broken URL: https://htk-coq-website-fix.github.io/doc/current/refman/addendum/type-classes.html (already broken before this PR of course). [And here is one for the stdlib: https://htk-coq-website-fix.github.io/distrib/current/stdlib/Coq.Logic.Classical_Prop.html.]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've pushed a fix for this on master after merging your PR. Unfortunately, I couldn't push it on the PR first to test it with your fork, probably because your master branch is protected. Hopefully, it'll work on the first attempt. EDIT: It did.
Actually, it's unclear that this method of testing works because the simple server that it runs doesn't seem to pick up the 404.html page (whereas GitHub Pages possibly could). |
I tested this on GitHub Pages. https://github.com/htk-coq-website-fix/htk-coq-website-fix.github.io/ There might be missing cases, of course. I don't know enough about all the old links. |
It's night where I live. It might be best to merge the PR now and then add the missing cases later. I believe I handled the existing cases correctly, and you can independently test this on the fork (https://htk-coq-website-fix.github.io) |
I believe I handled all cases |
Thanks a lot! I don't want to make you stay up late. It's also already pretty late here. I'll do some further testing using your website and merge in the morning. If there are additional cases to handle (there probably are), they can be added later on based on the model you provided. |
No description provided.