From 116fb6a8835d92dfd5b75436757b1d87709c5c84 Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Tue, 18 Mar 2025 00:15:59 -0400 Subject: [PATCH] restore previous functionality with new processing system --- TODO.md | 4 +++- cmd/zona/main.go | 8 ++++++++ internal/builder/process.go | 4 +++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/TODO.md b/TODO.md index 788e1d4..4d1232e 100644 --- a/TODO.md +++ b/TODO.md @@ -1,6 +1,8 @@ # TODO -**Last working on:** I fixed the frontmatter processing; now I should verify that the entire directory is being processed okay. +- Fix the relative URL situation in the headers + - The link that's defined in header file should be relative to root, not the page being processed. + - How to handle this? ## Thoroughly test directory processing diff --git a/cmd/zona/main.go b/cmd/zona/main.go index f892939..e1d8a59 100644 --- a/cmd/zona/main.go +++ b/cmd/zona/main.go @@ -43,9 +43,17 @@ func main() { } settings := builder.GetSettings(*rootPath, "foobar") // err := builder.Traverse(*rootPath, "foobar", settings) + // traverse the source and process file metadata pm, err := builder.ProcessTraverse(*rootPath, "foobar", settings) if err != nil { fmt.Printf("Error: %s\n", err.Error()) + os.Exit(1) } + err = builder.BuildProcessedFiles(pm, settings) + if err != nil { + fmt.Printf("Error: %s\n", err.Error()) + os.Exit(1) + } + fmt.Printf("%#v", pm) } diff --git a/internal/builder/process.go b/internal/builder/process.go index 1f2e2c0..b46cedb 100644 --- a/internal/builder/process.go +++ b/internal/builder/process.go @@ -53,7 +53,9 @@ func processFile(inPath string, entry fs.DirEntry, err error, outRoot string, se var toProcess bool var outPath string var ext string - if !entry.IsDir() { + if entry.IsDir() { + return nil + } else { ext = filepath.Ext(inPath) outPath = util.ReplaceRoot(inPath, outRoot) // NOTE: This could be an if statement, but keeping