This commit is contained in:
Félix Baylac Jacqué 2023-01-08 19:02:19 +01:00
parent d1d9358335
commit 02d641f711
No known key found for this signature in database
GPG Key ID: EFD315F31848DBA4
3 changed files with 59 additions and 6 deletions

View File

@ -2,8 +2,20 @@
<html>
<head>
<title>Nom Nom GC</title>
<style>{{> css}}</style>
</head>
<body>
Hello world
<nav>
<ul>
<li><h1>Nom Nom GC</h1></li>
<li><a href="/">Home</a></li>
<li><a href="/projects">Projects</a></li>
<li><a href="/login">Login</a></li>
</nav>
<main>
<div id="main-container">
Hello world
</div>
</main>
</body>
</html>

41
src/templates/main.css Normal file
View File

@ -0,0 +1,41 @@
body {
background-color: #F9FA57;
color: black;
font-family: sans-serif;
}
#login {
}
a {
color: #C800E4;
}
main {
display: flex;
flex-direction: row;
justify-content: center;
}
nav {
padding: 1em;
margin: 1em;
background-color: white;
box-shadow: 10px 15px #C800E4;
}
nav > ul {
display: flex;
justify-content: space-around;
list-style-type: none;
align-items: center;
}
#main-container {
background-color: white;
box-shadow: 10px 15px #C800E4;
width: 85%;
padding: 2em;
margin: 1em;
}

View File

@ -4,11 +4,11 @@ use std::path::PathBuf;
pub fn landing_page() -> Result<String, RenderError> {
let mut hb = handlebars::Handlebars::new();
let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
path = path.join("src/templates/landing.hbs");
let p: &str = path.to_str().unwrap();
println!("{}", p);
hb.register_template_file("landing", p)?;
let rootpath = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
let landing_path = rootpath.join("src/templates/landing.hbs");
let css = rootpath.join("src/templates/main.css");
hb.register_template_file("landing", landing_path.to_str().unwrap())?;
hb.register_template_file("css", css.to_str().unwrap())?;
let data = json!({
});
hb.render("landing", &data)