Skip to content

HTML Redirects Missing #336

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

Closed
danielzgtg opened this issue Apr 17, 2020 · 4 comments
Closed

HTML Redirects Missing #336

danielzgtg opened this issue Apr 17, 2020 · 4 comments
Labels
C-bug Category: Bug

Comments

@danielzgtg
Copy link

https://github.com/rust-lang/rust/blob/7f3df5772439eee1c512ed2eb540beef1124d236/RELEASES.md#compiler-1 links to https://forge.rust-lang.org/platform-support.html but it is now a 404.

I had to dig around to find out that it has been moved to https://forge.rust-lang.org/release/platform-support.html now. Looking through archive.org, it seems that the page was indeed moved and there used to be a redirect to the proper page. However, that redirect is missing now. It would be nice for the redirect to be restored or the dead link to be fixed.

@XAMPPRocky
Copy link
Member

XAMPPRocky commented Apr 17, 2020

Thank you for your issue! The code for this is here. I can replicate that its not generating redirects, however I can't tell why. It doesn't panic, and seems to be writing to the correct paths.

for (filename, url) in REDIRECTS {
let template = include_str!("../redirect.html").replace("{{url}}", url);
log::trace!("Redirecting {} to {}.", filename, url);
if let Some(parent) = Path::new(filename).parent() {
std::fs::create_dir_all(dir.join(parent)).unwrap();
}
std::fs::write(dir.join(filename), template).unwrap();
}

@XAMPPRocky XAMPPRocky added C-bug Category: Bug help wanted labels Apr 17, 2020
@XAMPPRocky XAMPPRocky changed the title https://forge.rust-lang.org/platform-support.html no longer works HTML Redirects Missing Apr 17, 2020
@danielzgtg
Copy link
Author

I tried to do a Git bisect but ran into a strange problem. I can't find the last good commit.

I've tried d89a96a which is the first commit with mdbook, edd938e which is an early commit with blacksmith, 8fcbfe7 which is between 2019-09-21 and 2019-10-08, as well as many other commits. In all of those cases, I get a 404 when visiting http://127.0.0.1:3000/platform-support.html after running mdbook serve. It doesn't generate a file in book/ either.

This is unexpected because archive.org clearly shows that the redirects were present at some time. This fact worsens the problem because I can't reproduce that desired behavior.

@XAMPPRocky
Copy link
Member

@danielzgtg Thank you for doing this, would you be able to test the code using a previous mdbook version? It could be a regression in the tool itself.

@XAMPPRocky
Copy link
Member

This has now been resolved with the release of mdbook 0.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Bug
Projects
None yet
Development

No branches or pull requests

2 participants