add footers to markdown modules
This commit is contained in:
parent
b298331369
commit
911db49475
1 changed files with 19 additions and 4 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue