rust-lang / rust-forge

Information useful to people contributing to Rust

Home Page:https://forge.rust-lang.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HTML Redirects Missing

danielzgtg opened this issue · comments

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.

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();
}

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.

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

This has now been resolved with the release of mdbook 0.4.0