Add footer to recipe pages

This commit is contained in:
~erin 2022-01-23 18:57:28 -05:00
parent 93573799be
commit 168e00a87f
No known key found for this signature in database
GPG Key ID: DA70E064A8C70F44
1 changed files with 11 additions and 1 deletions

View File

@ -171,6 +171,15 @@ impl Recipe {
}
pub fn construct_page(&self) {
// Create the footer
let footer = Container::new(ContainerType::Footer)
.with_raw(r#"<hr>"#) // Line seperator
.with_link("/", "home") // Link to the root page
.with_link("/rss.xml", "rss") // Link the the Atom feed
// License info
.with_paragraph("Software licensed under the CNPLv7+")
.with_paragraph("Recipes under Public Domain");
// Metadata
let meta = Container::new(ContainerType::UnorderedList)
.with_attributes(vec![("class", "recipe")])
@ -247,7 +256,8 @@ impl Recipe {
&self.posted_date.year(),
&self.posted_date.month(),
&self.posted_date.day()))
.with_raw(edit_date);
.with_raw(edit_date)
.with_container(footer);
write_html(recipe_page.to_html_string(), "en", Some(&self.shortcode));
}