go.astrophena.name/gen Module
An another static site generator.
This package is unmaintained.
package frontmatter
import "go.astrophena.name/gen/frontmatter"
Package frontmatter implements frontmatter-related functions.
Index
- Variables
- func Contains(text string) (contains bool, err error)
- func Extract(text string) (frontmatter, content string, err error)
- func Parse(text string, obj interface{}) (content string, err error)
Variables
var ErrNotDetected = errors.New("no frontmatter detected")
ErrNotDetected is returned when no frontmatter has been detected.
Functions
func Contains
func Contains(text string) (contains bool, err error)
Contains returns true if the supplied text includes frontmatter.
func Extract
func Extract(text string) (frontmatter, content string, err error)
Extract extracts frontmatter from supplied text, returning frontmatter and content.
func Parse
func Parse(text string, obj interface{}) (content string, err error)
Parse extracts frontmatter from supplied text and unmarshals it into obj, returning content without frontmatter and an error.