diff --git a/src/main.rs b/src/main.rs index 39517ae..49e2c2f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,12 +1,14 @@ -use std::{fs,io}; +mod links; + +use links::{RustyLinks, MetaData}; + +use std::{fs, io}; use std::path::Path; use chrono::{DateTime, Utc}; use serde_yaml::{self}; use minijinja::{Environment}; -mod links; -use links::{RustyLinks,MetaData}; pub fn copy_recursively(source: impl AsRef, destination: impl AsRef) -> io::Result<()> { // Credit: https://nick.groenen.me/notes/recursively-copy-files-in-rust/ @@ -30,8 +32,8 @@ fn load_links(file_name: &str) -> RustyLinks { let mut rusty_links: RustyLinks = serde_yaml::from_reader(links_yaml).expect("Could not read values"); // Set last updated time to now. - let now : DateTime = Utc::now(); - let metadata : MetaData = MetaData { last_updated: now.to_rfc2822()}; + let now: DateTime = Utc::now(); + let metadata: MetaData = MetaData { last_updated: now.to_rfc2822() }; rusty_links.metadata = Some(metadata); rusty_links @@ -40,7 +42,6 @@ fn load_links(file_name: &str) -> RustyLinks { fn render_links(rusty_links: RustyLinks) -> String { let main = std::fs::read_to_string("templates/links/links.html").expect("Could not find links.html"); - let mut env = Environment::new(); env.add_template("main", &*main).unwrap(); let tmpl = env.get_template("main").unwrap(); diff --git a/static/style.css b/static/links.css similarity index 100% rename from static/style.css rename to static/links.css diff --git a/templates/links/links.html b/templates/links/links.html index a55c24c..ade7eaa 100644 --- a/templates/links/links.html +++ b/templates/links/links.html @@ -1,11 +1,11 @@ - + {{config.title}} - +