diff --git a/.gitignore b/.gitignore index 2b2e86d..9c5a16b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /target +/screenshots notes diff --git a/src/main.rs b/src/main.rs index 8275223..bf1bb7c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,6 +9,9 @@ extern crate rocket_contrib; extern crate serde_derive; extern crate tera; +use std::path::{Path, PathBuf}; + +use rocket::response::NamedFile; use rocket_contrib::templates::Template; #[derive(Debug, Serialize)] @@ -26,6 +29,11 @@ fn index() -> Template { Template::render("index", &context) } +#[get("/")] +fn files(file: PathBuf) -> Option { + NamedFile::open(Path::new("static/").join(file)).ok() +} + #[catch(404)] fn not_found() -> Template { debug!("404 Page Not Found"); @@ -38,7 +46,7 @@ fn not_found() -> Template { fn main() { rocket::ignite() - .mount("/", routes![index]) + .mount("/", routes![index, files]) .register(catchers![not_found]) .attach(Template::fairing()) .launch(); diff --git a/static/favicon.png b/static/favicon.png new file mode 100644 index 0000000..2415c04 Binary files /dev/null and b/static/favicon.png differ diff --git a/static/glyph.svg b/static/glyph.svg new file mode 100644 index 0000000..3b9dfc2 --- /dev/null +++ b/static/glyph.svg @@ -0,0 +1,4 @@ + + + + diff --git a/templates/base.html.tera b/templates/base.html.tera new file mode 100644 index 0000000..b1488c5 --- /dev/null +++ b/templates/base.html.tera @@ -0,0 +1,81 @@ + + + + + + + mycelial technology | glyph + + + + + + + {% block nav %}{% endblock %} + + diff --git a/templates/index.html.tera b/templates/index.html.tera index 47992a0..d243088 100644 --- a/templates/index.html.tera +++ b/templates/index.html.tera @@ -1,75 +1,12 @@ - - - - - - mycelial technology | glyph - - - - - - -

mycelial technology

-
- +{% extends "nav" %} +{% block content %} +

Welcome to the personal website of glyph.

Contact Information

-
- - - +
+ +{%- endblock %} diff --git a/templates/index.html.tera.dark b/templates/index.html.tera.dark new file mode 100644 index 0000000..c7623e8 --- /dev/null +++ b/templates/index.html.tera.dark @@ -0,0 +1,76 @@ + + + + + + mycelial technology | glyph + + + + + + +

mycelial technology

+
+ +

Welcome to the personal website of glyph.

+

Contact Information

+
+ + + diff --git a/templates/nav.html.tera b/templates/nav.html.tera new file mode 100644 index 0000000..be00b6c --- /dev/null +++ b/templates/nav.html.tera @@ -0,0 +1,22 @@ +{% extends "base" %} +{% block nav -%} +

mycelial technology

+
+ + {%- block content %}{%- endblock %} + +{%- endblock %}