remove stray unpublishes from html dir

trunk 0.2.0
nbsp 2025-01-20 14:40:16 +02:00
parent 5a7db89b47
commit 462d18850e
No known key found for this signature in database
GPG Key ID: 7184AC1C9835CE48
2 changed files with 2 additions and 0 deletions

View File

@ -1 +1,2 @@
patch type="fixed" "symlink html directory" patch type="fixed" "symlink html directory"
patch type="fixed" "remove stray unpublishes from html dir"

View File

@ -398,6 +398,7 @@ func Publish() {
return // TODO: expose this error to the user return // TODO: expose this error to the user
} }
if cfg.Publishing { if cfg.Publishing {
os.RemoveAll(PathUserWWW) // remove all post and start over
if _, err := os.Stat(PathUserWWW); os.IsNotExist(err) { if _, err := os.Stat(PathUserWWW); os.IsNotExist(err) {
os.MkdirAll(PathUserWWW, 0700) os.MkdirAll(PathUserWWW, 0700)
os.Symlink(path.Join(PathUserConfig, "style.css"), path.Join(PathUserWWW, "style.css")) os.Symlink(path.Join(PathUserConfig, "style.css"), path.Join(PathUserWWW, "style.css"))