Redirect
This commit is contained in:
parent
e6cc4c5d13
commit
301401e568
2 changed files with 12 additions and 0 deletions
|
@ -1426,6 +1426,16 @@ impl Context {
|
|||
.open(&redir_dst) {
|
||||
try_err!(layout::redirect(&mut redirect_out, file_name), &redir_dst);
|
||||
}
|
||||
|
||||
// If the item is a macro, redirect from the old macro URL (with !)
|
||||
// to the new one (without).
|
||||
// FIXME(#35705) remove this redirect.
|
||||
if item_type == ItemType::Macro {
|
||||
let redir_name = format!("{}.{}!.html", item_type, name);
|
||||
let redir_dst = self.dst.join(redir_name);
|
||||
let mut redirect_out = try_err!(File::create(&redir_dst), &redir_dst);
|
||||
try_err!(layout::redirect(&mut redirect_out, file_name), &redir_dst);
|
||||
}
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue