Skip to main content

parse_frontmatter

Function parse_frontmatter 

Source
pub fn parse_frontmatter(
    source: &str,
) -> Result<(Frontmatter, &str), TemplateError>
Expand description

Parse YAML frontmatter delimited by --- lines.

Returns the parsed Frontmatter and a string slice pointing to the template body after the closing ---.

ยงErrors

Returns TemplateError::Syntax if the frontmatter block is missing, unclosed, or contains invalid declarations.