diff --git a/assets/static/maggie-ellie-comfy.jpeg b/assets/static/maggie-ellie-comfy.jpeg new file mode 100644 index 0000000..c4bac3b Binary files /dev/null and b/assets/static/maggie-ellie-comfy.jpeg differ diff --git a/assets/templates/home.html b/assets/templates/home.html new file mode 100644 index 0000000..ff78bb1 --- /dev/null +++ b/assets/templates/home.html @@ -0,0 +1,26 @@ + + + +
+Hello! I'm Price, a Linux user and Neovim addict. This necessarily means I am either bald or balding. Oh, also I + sometimes write Rust. This page is generated from a Rust static site generator I wrote, it's not very good but it + makes me happy. I'm a big fan of reproducible systems and infrastructure, though I'm not sure if I'm sold on NixOS + just yet. I hold it as a dumb source of pride that I can wipe my laptop and have everything back to normal within 20 + minutes depending on how nice Github's rate limit wants to play. Hit me up at my email if you want to get in contact.
+Maggie and Ellie say hi:
+ + +{% include "footer.html" %} + + \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index ed053e3..9d6c8e1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,14 +1,14 @@ use anyhow::{Context, Ok}; -use clap::Parser; use blog::{ markdown::article::{Article, FrontMatter}, page_gen::{ articles::Articles, - tags::{TagArticles, Tags}, + tags::{TagArticles, Tags}, home::Home, }, TemplateRenderer, }; -use std::{collections::HashMap, path::PathBuf}; +use clap::Parser; +use std::{collections::HashMap, fs::copy, path::PathBuf}; use tera::Tera; #[derive(Parser, Debug)] @@ -30,8 +30,8 @@ struct Args { fn main() -> anyhow::Result<()> { let comrak_settings = blog::markdown::MDComrakSettings::default().unwrap(); let posts_dir = PathBuf::from(concat!(env!("CARGO_MANIFEST_DIR"), "/posts/")); - let posts_walkable = std::fs::read_dir(&posts_dir) - .context("Unable to read posts directory!")?; + let posts_walkable = + std::fs::read_dir(&posts_dir).context("Unable to read posts directory!")?; let out_path = PathBuf::from(concat!(env!("CARGO_MANIFEST_DIR"), "/out")); std::fs::create_dir_all(&out_path) .context(format!("Unable to create out directory at '{out_path:?}'"))?; @@ -78,6 +78,14 @@ fn main() -> anyhow::Result<()> { } println!("Finished rendering Article templates"); + println!("Rendering Articles Page"); + let articles_page = Articles::new(&article_links) + .render_template(&tera) + .context("Main Articles Page Rendering Error")?; + let articles_write_path = &out_path.join("articles.html"); + write_file(&articles_write_path, articles_page.as_bytes())?; + println!("Finished Rendering Articles Page"); + println!("Rendering Tags Page"); let tags_page = Tags::new(&detected_tags_article.keys().collect::