From 6eacdff12eb876999edb477e7fca5c10ee00ece7 Mon Sep 17 00:00:00 2001 From: "Zed A. Shaw" Date: Mon, 18 Aug 2025 20:51:10 -0400 Subject: [PATCH] Don't generate the layout inside the layout and do a build before watch. BUG: This suddenly crashes now when watching, which sucks. --- main.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index d88fdba..61f395b 100644 --- a/main.go +++ b/main.go @@ -130,10 +130,14 @@ func RePrefixPath(path string, new_prefix string) string { return filepath.Join(prefixed_path...) } +func SamePath(a string, b string) bool { + return filepath.ToSlash(a) == filepath.ToSlash(b) +} + func ProcessDirEntry(path string, d fs.DirEntry, err error) error { settings := config.Settings - if !d.IsDir() { + if !d.IsDir() && !SamePath(path, config.Settings.Layout) { if err != nil { return Fail(err, "path: %s", path); } source_name, ext, found := SplitPathExt(path) @@ -289,6 +293,8 @@ func main() { switch command { case "watch": config.Load(config_file) + SyncStaticDir(); + RenderPages(); WatchDir() case "init": InitConfig(config_file)