Exemple #1
0
// Pretty creates a new FrontMatter object
func Pretty(content []byte) (interface{}, string, error) {
	frontType := parser.DetectFrontMatter(rune(content[0]))
	front, err := frontType.Parse(content)

	if err != nil {
		return []string{}, mainTitle, err
	}

	object := new(frontmatter)
	object.Type = "object"
	object.Name = mainName

	return rawToPretty(front, object), mainTitle, nil
}
Exemple #2
0
func (p *Page) detectFrontMatter() (f *parser.FrontmatterType) {
	return parser.DetectFrontMatter(rune(p.frontmatter[0]))
}