Skip to main content

compile_page

Function compile_page 

Source
pub fn compile_page(input: &str) -> Result<(HashMap<String, Value>, String)>
Expand description

Compile a complete page: parse frontmatter, render Markdown to HTML.

Returns (frontmatter, html_body).

§Errors

Currently infallible — returns Ok for every input. The Result signature is preserved so that future stricter validation can surface failures without a breaking API change.

§Examples

let input = "---\ntitle: Test\n---\n# Heading";
let (fm, html) = ssg_core::compile_page(input).unwrap();
assert_eq!(fm.get("title").and_then(|v| v.as_str()), Some("Test"));
assert!(html.contains("<h1>Heading</h1>"));