frontmatter icon indicating copy to clipboard operation
frontmatter copied to clipboard

Frontmatter golang Codec

Build Status GoDoc

Frontmatter

frontmatter is a golang package that provides a Marshaler/Unmarshaler for frontmatter files.

A frontmatter file is a file with any textual content, and a yaml frontmatter block for metadata, as defined by Jekyll

The frontmatter File must have the following format:

  `---\n`
  <yaml content>
  `\n---\n`
  <text content>

Where, the 'yaml content' is handled by http://gopkg.in/yaml.v2

And where, the text content is 'content' field's value.

The 'content' field must:

  exist
  tagged `fm:"content"`
  be exported
  be of the correct type.

A correct type is:

 - string, *string
 - any convertible to the above two.

see go doc for details.

Installation

first get go then go get github.com/ericaro/frontmatter

This package depends on http://gopkg.in/yaml.v2

License

frontmatter is available under the Apache License, Version 2.0.

Branches

master: Build Status against go versions:

  • 1.3
  • 1.4
  • tip