From 79dc449f1e204c1fb6e55cd24a32433beadea145 Mon Sep 17 00:00:00 2001 From: glyph Date: Sat, 9 May 2020 15:44:33 +0100 Subject: [PATCH] Add background route and draft text --- src/main.rs | 17 +++++++++++++---- templates/background.html.tera | 8 ++++++++ templates/index.html.tera | 6 +++--- templates/nav.html.tera | 4 ++-- 4 files changed, 26 insertions(+), 9 deletions(-) create mode 100644 templates/background.html.tera diff --git a/src/main.rs b/src/main.rs index bf1bb7c..ab62962 100644 --- a/src/main.rs +++ b/src/main.rs @@ -20,6 +20,11 @@ struct FlashContext { flash_msg: Option, } +#[get("/")] +fn files(file: PathBuf) -> Option { + NamedFile::open(Path::new("static/").join(file)).ok() +} + #[get("/")] fn index() -> Template { let context = FlashContext { @@ -29,9 +34,13 @@ fn index() -> Template { Template::render("index", &context) } -#[get("/")] -fn files(file: PathBuf) -> Option { - NamedFile::open(Path::new("static/").join(file)).ok() +#[get("/background")] +fn background() -> Template { + let context = FlashContext { + flash_name: None, + flash_msg: None, + }; + Template::render("background", &context) } #[catch(404)] @@ -46,7 +55,7 @@ fn not_found() -> Template { fn main() { rocket::ignite() - .mount("/", routes![index, files]) + .mount("/", routes![files, index, background]) .register(catchers![not_found]) .attach(Template::fairing()) .launch(); diff --git a/templates/background.html.tera b/templates/background.html.tera new file mode 100644 index 0000000..436afae --- /dev/null +++ b/templates/background.html.tera @@ -0,0 +1,8 @@ +{% extends "nav" %} +{% block content %} +

Background

+
+

I was born and raised in the coastal city of Durban, South Africa, which lies between the Indian Ocean and Drakensberg Mountains. Following completion of high school I moved to Michigan, USA and completed a Bachelor of Science in anthropology (major) and biology (minor) at Grand Valley State University. I later returned to South Africa and completed a Master of Social Science in social anthropology at the University of Cape Town, with research focused on decentralised networks of medicinal plant harvesters and herbalists (Rasta bush doctors). I then went on to work as an applied anthropologist and ethnobotanist in the non-profit sector.

+

Following a year spent travelling in South America, I restructured my livelihood and life around my core interests: carbon-based and silicon-based technologies (biology and computers). Since then I have founded Harmonic Mycology, a mycology collective dedicated to developing and distributing mycelial medicines, teaching mushroom cultivation and encouraging the formation of humyn-fungal networks. In parallel to those activities, I have worked as an autodidactic software developer on private and open-source projects; most-recently, PeachCloud.

+

I hold a deep fascination with the processes through which humyns form relationships with other living beings. When not behind the keyboard, you can find me looking at mushrooms, riding my bicycle or reading sci-fi. I'm dreaming of a three-month adventure across Japan ⛩ .

+{%- endblock %} diff --git a/templates/index.html.tera b/templates/index.html.tera index d243088..e1c0f1a 100644 --- a/templates/index.html.tera +++ b/templates/index.html.tera @@ -5,8 +5,8 @@

Contact Information


{%- endblock %} diff --git a/templates/nav.html.tera b/templates/nav.html.tera index be00b6c..01869a0 100644 --- a/templates/nav.html.tera +++ b/templates/nav.html.tera @@ -1,10 +1,10 @@ {% extends "base" %} {% block nav -%} -

mycelial technology

+

mycelial technology