Example #1
0
File: utils.go Project: get3w/get3w
func (parser *Parser) read(frontmatter interface{}, key ...string) ([]byte, []byte) {
	data, _ := parser.readAll(key...)
	front, remaining := fmatter.ReadRaw(data)
	if len(front) > 0 {
		yaml.Unmarshal(front, frontmatter)
	}
	return front, remaining
}
Example #2
0
File: utils.go Project: get3w/get3w
func (parser *Parser) readRemaining(key ...string) []byte {
	data, _ := parser.readAll(key...)
	_, remaining := fmatter.ReadRaw(data)
	return remaining
}