get frontmatter

This commit is contained in:
Adam 2024-01-19 18:26:38 -05:00
parent 7366f7ba62
commit 348203176c

View file

@ -13,7 +13,8 @@ pub async fn slingshot(path: String) -> Result<Vec<ArticleData>, ServerFnError>
if let Some(filetype) = filepath.extension() {
if filetype == "md" {
let file = std::fs::read_to_string(filepath)?;
let html_from_md = femark::process_markdown_to_html(&file.to_string())
let html_from_md =
femark::process_markdown_to_html_with_frontmatter(&file.to_string(), true)
.expect("Problem processing markdown");
let content = html_from_md.content;
let _toc = html_from_md.toc;