Have a few of the basic admin pages working after switching to the API+View pattern.

This commit is contained in:
Zed A. Shaw 2025-07-16 01:06:14 -04:00
parent fa7f886a59
commit 2b40d6fdc3
9 changed files with 188 additions and 29 deletions

View file

@ -34,8 +34,14 @@ func RenderPages(pages_path string, target string, layout string) {
prefixed_path := append([]string{target}, split_path...)
target_path := filepath.Join(prefixed_path...)
_, err := os.Stat(target_path)
// compare time stamps and skip if not newer
if os.IsNotExist(err) {
log.Println("MAKING: ", "MAKE THE DAMN PATH NO FILE")
// os.MkdirAll(target_path, 0750)
}
// TODO: compare time stamps and skip if not newer
out, err := os.OpenFile(target_path, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0644)
if err != nil { return Fail(err, "writing file %s", target_path) }