Documentation
¶
Overview ¶
Package fmatter is a simple YAML Front Matter parser, using the gopkg.in/yaml.v2 package.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Read ¶
Read detects and parses the front matter data, and returns the remaining contents. If no front matter is found, the entire file contents are returned. For details on the frontmatter parameter, please see the gopkg.in/yaml.v2 package.
Example ¶
data := []byte(`---
title: Some Title
---
content`)
var frontmatter struct{ Title string }
content, _ := Read(data, &frontmatter)
fmt.Println(content)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.