Skip to content

Commit 75c7e1d

Browse files
committed
Remove old HTML pages converted to templates
1 parent 5ee5615 commit 75c7e1d

File tree

3 files changed

+14
-298
lines changed

3 files changed

+14
-298
lines changed

site/src/server.rs

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -586,10 +586,6 @@ async fn handle_fs_path(req: &Request, path: &str) -> Option<http::Response<hype
586586
return Some(not_found());
587587
}
588588

589-
if !Path::new(&fs_path).is_file() {
590-
return None;
591-
}
592-
593589
let etag = ETag::from_str(&*format!(r#""{}""#, *VERSION_UUID)).unwrap();
594590
let mut response = http::Response::builder()
595591
.header_typed(etag.clone())
@@ -602,6 +598,20 @@ async fn handle_fs_path(req: &Request, path: &str) -> Option<http::Response<hype
602598
}
603599
}
604600

601+
let source = match path {
602+
"/help.html" | "/status.html" => TEMPLATES
603+
.render(&format!("pages/{}", path.trim_start_matches("/")))
604+
.await
605+
.unwrap()
606+
.into_bytes(),
607+
_ => {
608+
if !Path::new(&fs_path).is_file() {
609+
return None;
610+
}
611+
fs::read(&fs_path).unwrap()
612+
}
613+
};
614+
605615
let p = Path::new(&fs_path);
606616
match p.extension().and_then(|x| x.to_str()) {
607617
Some("html") => response = response.header_typed(ContentType::html()),
@@ -613,15 +623,6 @@ async fn handle_fs_path(req: &Request, path: &str) -> Option<http::Response<hype
613623
_ => (),
614624
}
615625

616-
let source = match path {
617-
"/help.html" | "/status.html" => TEMPLATES
618-
.render(&format!("pages/{}", path.trim_start_matches("/")))
619-
.await
620-
.unwrap()
621-
.into_bytes(),
622-
_ => fs::read(&fs_path).unwrap(),
623-
};
624-
625626
Some(response.body(hyper::Body::from(source)).unwrap())
626627
}
627628

site/static/help.html

Lines changed: 0 additions & 64 deletions
This file was deleted.

site/static/status.html

Lines changed: 0 additions & 221 deletions
This file was deleted.

0 commit comments

Comments
 (0)