frontmatter

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package frontmatter provides utilities for parsing YAML frontmatter from markdown files.

Index

Constants

View Source
const MaxFrontmatterLines = 100

MaxFrontmatterLines limits how far we search for frontmatter closing delimiter to prevent frontmatter bomb attacks (malicious files with unclosed frontmatter)

Variables

This section is empty.

Functions

func Split

func Split(data []byte) (frontmatter, content []byte, err error)

Split separates YAML frontmatter from markdown content Returns frontmatter bytes, content bytes, and any error

The function expects frontmatter to be delimited by "---" lines:

---
key: value
---
Content here...

If no frontmatter is present, returns nil frontmatter and all data as content. If frontmatter is not closed within MaxFrontmatterLines, returns an error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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