frontmatter

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Extract added in v1.1.1

func Extract(content string) (fm string, body string)

Extract splits content into frontmatter (including delimiters) and body. When no valid frontmatter exists, fm is empty and body is the full content (BOM-stripped).

func Strip

func Strip(content string) string

Strip removes YAML frontmatter from markdown content. Frontmatter must start at byte 0 (after optional UTF-8 BOM) with "---\n" or "---\r\n". If no valid closing delimiter is found, content is returned unchanged.

Types

This section is empty.

Jump to

Keyboard shortcuts

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