1
Fork 0

put back macro redirect

This commit is contained in:
Guillaume Gomez 2019-02-09 01:07:38 +01:00
parent 397eb4f237
commit d26475505b
2 changed files with 10 additions and 1 deletions

View file

@ -2245,6 +2245,15 @@ impl Context {
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).
if item_type == ItemType::Macro {
let redir_name = format!("{}.{}!.html", item_type, name);
let redir_dst = self.dst.join(redir_name);
let redirect_out = try_err!(File::create(&redir_dst), &redir_dst);
let mut redirect_out = BufWriter::new(redirect_out);
try_err!(layout::redirect(&mut redirect_out, file_name), &redir_dst);
}
}
}
Ok(())