use std::fs;
use std::path::PathBuf;
pub fn phoenix_html_404(output_dir: &PathBuf){
let body: String = String::from(r#"<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="utf-8" />
<title>404 not found</title>
<link rel="stylesheet" href="book/dark.css" />
<script type="text/javascript">
function redirectionToIndex(){
document.location.href="index.html";
}
</script>
</head>
<body onLoad="setTimeout('redirectionToIndex()', 1000)">
<div>In 2 seconds you will be redirected on the main page... normally</div>
</body>
</html>
"#);
let page_404: PathBuf = output_dir.join(&PathBuf::from("404.html"));
match fs::write(&page_404, body) {
Ok(_) => {},
Err(err) => panic!("phoenix_html_404 : cannot write file {:?}\n\tError {}", page_404, err)
};
}