diff --git a/src/html/books.rs b/src/html/books.rs new file mode 100644 index 0000000..d436130 --- /dev/null +++ b/src/html/books.rs @@ -0,0 +1,24 @@ +use axum::{ + response::IntoResponse, + routing::{get, Router}, +}; + +use super::templates::{ + BooksTemplate, HtmlTemplate, MonkAndRobotTemplate, +}; + +pub fn get_router() -> Router { + Router::new() + .route("/", get(books)) + .route("/monk&robot", get(monk_robot)) +} + +async fn books() -> impl IntoResponse { + let books_page = BooksTemplate {}; + HtmlTemplate(books_page) +} + +async fn monk_robot() -> impl IntoResponse { + let monk_robot = MonkAndRobotTemplate {}; + HtmlTemplate(monk_robot) +} diff --git a/src/html/mod.rs b/src/html/mod.rs index 4b08e1a..a11514d 100644 --- a/src/html/mod.rs +++ b/src/html/mod.rs @@ -3,6 +3,7 @@ use serde::Deserialize; pub mod admin; pub mod posts; pub mod projects; +pub mod books; pub mod root; pub mod templates; diff --git a/src/html/root.rs b/src/html/root.rs index de0583b..6be9b55 100644 --- a/src/html/root.rs +++ b/src/html/root.rs @@ -22,12 +22,9 @@ use crate::{ }; use super::{ - admin, - posts::{self, get_articles_date_sorted}, - projects, - templates::{ - AboutTemplate, AiTemplate, BlogrollTemplate, BooksTemplate, ContactTemplate, CookingTemplate, CreationTemplate, GiftsTemplate, HomeTemplate, HtmlTemplate, InterestsTemplate, LinksPageTemplate, LoginTemplate, MoneyTemplate, NowTemplate, ResumeTemplate, SignupTemplate, TechnologyTemplate, TimeTemplate, UsesTemplate, WorkTemplate - }, + admin, books, posts::{self, get_articles_date_sorted}, projects, templates::{ + AboutTemplate, AiTemplate, BlogrollTemplate, ContactTemplate, CookingTemplate, CreationTemplate, GiftsTemplate, HomeTemplate, HtmlTemplate, InterestsTemplate, LinksPageTemplate, LoginTemplate, MoneyTemplate, NowTemplate, ResumeTemplate, SignupTemplate, TechnologyTemplate, TimeTemplate, UsesTemplate, WorkTemplate + } }; pub fn get_router(pool: PgPool) -> Router { @@ -39,6 +36,7 @@ pub fn get_router(pool: PgPool) -> Router { Router::new() .nest("/posts", posts::get_router()) .nest("/projects", projects::get_router()) + .nest("/books", books::get_router()) .nest("/admin", admin::get_router()) .nest_service( "/assets", @@ -56,7 +54,6 @@ pub fn get_router(pool: PgPool) -> Router { .route("/resume", get(resume)) .route("/gifts", get(gifts)) .route("/hire", get(work)) - .route("/books", get(books)) .route("/time", get(time)) .route("/cooking", get(cooking)) .route("/creation", get(creation)) @@ -173,11 +170,6 @@ pub async fn get_signup() -> impl IntoResponse { HtmlTemplate(SignupTemplate {}) } -async fn books() -> impl IntoResponse { - let books_page = BooksTemplate {}; - HtmlTemplate(books_page) -} - async fn time() -> impl IntoResponse { let time_page = TimeTemplate {}; HtmlTemplate(time_page) diff --git a/src/html/templates.rs b/src/html/templates.rs index ce16e75..243d94e 100644 --- a/src/html/templates.rs +++ b/src/html/templates.rs @@ -162,3 +162,7 @@ pub struct AdminTemplate {} #[derive(Template)] #[template(path = "money.html")] pub struct MoneyTemplate {} + +#[derive(Template)] +#[template(path = "monk&robot.html")] +pub struct MonkAndRobotTemplate {} diff --git a/templates/books.html b/templates/books.html index da23ceb..778a057 100755 --- a/templates/books.html +++ b/templates/books.html @@ -14,11 +14,15 @@
- A Prayer for the Crown Shy - Becky Chambers + Capitalism Vs Freedom - Rob Larson +
++ Hitchiker's Guide to the Galaxy - Douglas Adams
+ I have recently finished reading the Monk & Robot books by Becky Chambers. + They were absolutly fantastic and I would advise anyone to read them. +
++ The first book is A Psalm for the Wild Built + and the second is A Prayer for the Crown Shy. +
++ These are some of the happiest, most peaceful science fiction books that I have read in a long time. + Not that there is not challenge and conflict within them, but none that is unneccesary. + The books explore the idea of what we may need when all of our needs are taken care of. + All that could be provided for by society at least. + Everyone has food, shelter, community. + They are able to engage with what catches their interest, travel, explore, communicate to the level that they would like. + The world is idyllic in so many ways, but the larger questions of purpose and meaning are still present, which is the main focus. +
++ I find myself drawn to Solarpunk as the world (our world) seems to be filled with more and more negativity and sadness. + The escapism is not for adventure, glory, wars or battles. + But for a world where people care. + About eachother, about the world around them, about the objects that they use every day. +
++ Just like being more financially secure in my life has allowed me to zoom out a bit, think in a larger scope and on longer terms, + having physical needs met allows the characters of the book to think more deeply about life. + When the worry is always survival there is no point in wasting time or energy worrying about deeper needs. +
++ The world that Becky Chambers envisions here is bright, beautiful and caring. + As so many science fiction books explore possible future technologies, she explores a society and the internal landscape of its inhabitants. + It is a hopeful goal, something that I think we could aspire to create in our own world. + The technology does not seem massively advanced compared to what we have here, just that the mindset is fundamentally different. +
++ This mindset is what is attracting me to Solarpunk as a genre. + I have read the anthology "The Sunvault" in the past, and probably should again. + Not sure if it was the right time for me to resonate with those ideas. + I think it points the way for how we should try to progress as a society. + Use based production, living in harmony with the world and eachother. + The richness that we can produce used to heal the world and take care of eachother. + Valuing relationships, experiences, quality. +
++ It is a world that I would like to see come to pass, and they are some of my favourite books because they are so different. + I suspect that I will be reading them many times over, whenever I need a peaceful break from the world, or to envision a more hopeful future. +
+{% endblock %}