Skip to content

Commit

Permalink
Trying different library for frontmatter parsing due to gernest/front#6
Browse files Browse the repository at this point in the history
  • Loading branch information
mxro committed Mar 10, 2023
1 parent 2a3b15b commit f8202d9
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions packages/go-transform-cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import (
"path/filepath"
"strings"

"github.com/gernest/front"

"github.com/adrg/frontmatter"
"github.com/alecthomas/kong"
"github.com/gobwas/glob"
"gopkg.in/yaml.v2"
Expand Down Expand Up @@ -79,13 +78,8 @@ func ProcessFrontMatter(path string, processor frontmatterProcessorFn) error {

defer data.Close()

m := front.NewMatter()
m.Handle("---", front.YAMLHandler)
frontmatterMap, body, err := m.Parse(data)
if err != nil {
return err
}

var frontmatterMap map[string]interface{}
body, err := frontmatter.Parse(data, &frontmatterMap)
serr := processor(frontmatterMap)
if serr != nil {
return err
Expand Down

0 comments on commit f8202d9

Please sign in to comment.