frontmatter

package
v0.22.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package frontmatter splits and parses YAML frontmatter delimited by leading "---" lines in markdown content. It is the single home for this concern.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(content []byte, out any) (body []byte, found bool, err error)

Parse splits frontmatter from content and unmarshals the YAML block into out. When no frontmatter is present, found is false and out is left unchanged.

func Split

func Split(content []byte) (yamlBlock []byte, body []byte, found bool)

Split separates a leading YAML frontmatter block (opened and closed by a line containing exactly "---") from the body. When content has no such block, found is false and body is the original content unchanged.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL