fixed processFrontmatter and added test
This commit is contained in:
parent
35c14f09c0
commit
af81617db5
7 changed files with 162 additions and 183 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue