use build_html::{self, Container, ContainerType, Html, HtmlContainer}; use uuid::Uuid; mod captcha; mod io; mod networking; mod structures; mod tests; #[macro_use] extern crate rocket; use rocket::fairing::{Fairing, Info, Kind}; use rocket::fs::FileServer; use rocket::{http::Header, Request, Response}; use crate::captcha::*; use crate::networking::*; fn construct_main_page() { // Create the footer let footer = Container::new(ContainerType::Footer) .with_raw(r#"
Tags: "#); // Begin paragraph element for x in tags { // Go through the list of tags tags_html.push_str(format!("{},", x, x).as_str()); // Append the tags as a link } tags_html.push_str(r#"
"#); // End the paragraph // Recipes let mut recipes_container = Container::new(ContainerType::UnorderedList); for i in recipes { let mut link = String::new(); link.push_str("/"); link.push_str(&i.shortcode); recipes_container.add_link(link, &i.name); } // Create home page let home_page = build_html::HtmlPage::new() .with_head_link("favicon.ico", "icon") // Favicon .with_stylesheet("style.css") // Link stylesheet .with_meta(vec![("charset", "UTF-8")]) .with_meta(vec![ ("name", "viewport"), ("content", "width=device-width, initial-scale=1"), ]) // Display stuff .with_meta(vec![ ("name", "description"), ("content", structures::DESCRIPTION), ]) // Add the description .with_title(structures::TITLE) .with_header(1, structures::HEADER) .with_raw(r#"