add footers to markdown modules

This commit is contained in:
Penelope Gwen 2026-03-10 11:08:57 -07:00
parent b298331369
commit 911db49475

View file

@ -23,16 +23,31 @@ fn get_content_html(page_contents: &Vec<MarkdownModule>) -> String {
markdown::to_html_with_options(m.content.as_str(), &markdown::Options::gfm())
.ok()
.and_then(|c| {
format!(
"<div id='{}' class='markdown-module'>{}</div>",
let mut paragraph_module = format!(
"<div id='{}' class='markdown-module'>{}",
m.path
.file_stem()
.unwrap_or_default()
.to_str()
.unwrap_or_default(),
c
)
.into()
);
if let Some(created) = &m.metadata.date_created {
paragraph_module = format!(
"{}<p class='timestamp'>Created {}</p>",
paragraph_module, created
)
};
if let Some(updated) = &m.metadata.date_updated {
paragraph_module = format!(
"{}<p class='timestamp'>Modified {}</p>",
paragraph_module, updated
)
};
paragraph_module = format!("{}</div>", paragraph_module);
Some(paragraph_module)
})
})
.collect();