diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs index a41f801..a742cfe 100644 --- a/src/main.rs +++ b/src/main.rs @@ -121,6 +121,18 @@ fn main() { error!("Failed to copy static directory {:?} to {:?}", static_dir.source_path, destination)); } + + for redirect in &website.redirects { + let mut destination = destination.clone(); + destination.push(&redirect.full_url); + if let Some(path) = website.has_page(redirect, &redirect.redirect, "html") { + if args.html { + write_file(&generate_html_redirect(&path), &destination, "html"); + } + } else { + warn!("Redirect {:?} links to nonexistent page {:?}", redirect.name, redirect.redirect); + } + } } |