added build processed files
untested!
This commit is contained in:
parent
4315348cf5
commit
7644a31016
5 changed files with 97 additions and 9 deletions
|
@ -27,6 +27,7 @@ type File struct {
|
|||
OutPath string
|
||||
ShouldCopy bool
|
||||
HasFrontmatter bool
|
||||
FrontMatterLen int
|
||||
}
|
||||
|
||||
// NewProcessMemory initializes an empty
|
||||
|
@ -68,9 +69,11 @@ func processFile(inPath string, entry fs.DirEntry, err error, outRoot string, se
|
|||
|
||||
var pd *PageData
|
||||
hasFrontmatter := false
|
||||
l := 0
|
||||
if toProcess {
|
||||
// process its frontmatter here
|
||||
m, _, err := processFrontmatter(inPath)
|
||||
m, le, err := processFrontmatter(inPath)
|
||||
l = le
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -89,6 +92,7 @@ func processFile(inPath string, entry fs.DirEntry, err error, outRoot string, se
|
|||
outPath,
|
||||
!toProcess,
|
||||
hasFrontmatter,
|
||||
l,
|
||||
}
|
||||
if pd != nil && pd.Type == "post" {
|
||||
pm.Posts = append(pm.Posts, file)
|
||||
|
@ -96,3 +100,13 @@ func processFile(inPath string, entry fs.DirEntry, err error, outRoot string, se
|
|||
pm.Files = append(pm.Files, file)
|
||||
return nil
|
||||
}
|
||||
|
||||
func BuildProcessedFiles(pm *ProcessMemory, settings *Settings) error {
|
||||
for _, f := range pm.Files {
|
||||
err := BuildFile(f, settings)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue