encapsulate frontMatter logic inside a single function: ParseMetadata