Skip to content
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

Merged
merged 13 commits into from
Oct 12, 2023
Merged

Add subpath redirects #232

merged 13 commits into from
Oct 12, 2023

Conversation

huynhtrankhanh
Copy link
Contributor

No description provided.

@Zimmi48
Copy link
Member

Zimmi48 commented Oct 11, 2023

Thanks for your contribution!
For the record, I do not think that the CI in this repo is of any use for pull requests. However, you can test your changes locally using make && make run. If I'm not mistaken, you only need OCaml as a dependency for that.

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/");
Copy link
Member

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).

Copy link
Contributor Author

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)

Copy link
Contributor Author

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

Copy link
Member

@Zimmi48 Zimmi48 Oct 12, 2023

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.]

Copy link
Member

@Zimmi48 Zimmi48 Oct 12, 2023

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.

@Zimmi48
Copy link
Member

Zimmi48 commented Oct 11, 2023

Thanks for your contribution! For the record, I do not think that the CI in this repo is of any use for pull requests. However, you can test your changes locally using make && make run. If I'm not mistaken, you only need OCaml as a dependency for that.

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).

@huynhtrankhanh
Copy link
Contributor Author

huynhtrankhanh commented Oct 11, 2023

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.

@huynhtrankhanh
Copy link
Contributor Author

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)

@huynhtrankhanh
Copy link
Contributor Author

I believe I handled all cases

@Zimmi48
Copy link
Member

Zimmi48 commented Oct 11, 2023

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.

@Zimmi48 Zimmi48 merged commit 92e96df into coq:master Oct 12, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants