fixed processFrontmatter and added test

This commit is contained in:
Daniel Fichtinger 2025-01-01 23:55:16 -05:00
parent 35c14f09c0
commit af81617db5
No known key found for this signature in database
GPG key ID: D1B0947B25420214
7 changed files with 162 additions and 183 deletions

View file

@ -23,7 +23,7 @@ func buildFile(inPath string, entry fs.DirEntry, err error, outRoot string, sett
if err := util.CreateParents(outPath); err != nil {
return err
}
if err := ConvertFile(inPath, outPath, settings); err != nil {
if err := BuildHtmlFile(inPath, outPath, settings); err != nil {
return errors.Join(errors.New("Error processing file "+inPath), err)
} else {
return nil
@ -52,3 +52,12 @@ func Traverse(root string, outRoot string, settings *Settings) error {
err := filepath.WalkDir(root, walkFunc)
return err
}
func ProcessTraverse(root string, outRoot string, settings *Settings) error {
pm := NewProcessMemory()
walkFunc := func(path string, entry fs.DirEntry, err error) error {
return processFile(path, entry, err, outRoot, settings, pm)
}
err := filepath.WalkDir(root, walkFunc)
return err
}