From edb448413b7456b5dea2cbc86387dd45681effef Mon Sep 17 00:00:00 2001 From: Jason Streifling Date: Sat, 31 Aug 2024 01:42:37 +0200 Subject: [PATCH] Remove deleted article file when deleting article --- cmd/frontend/articles.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/frontend/articles.go b/cmd/frontend/articles.go index 89e6256..9066702 100644 --- a/cmd/frontend/articles.go +++ b/cmd/frontend/articles.go @@ -620,6 +620,12 @@ func DeleteArticle(c *b.Config, db *b.DB, s *b.CookieStore) http.HandlerFunc { return } + if err = os.Remove(fmt.Sprint(c.ArticleDir, "/", id, ".md")); err != nil { + log.Println(err) + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + feed, err := b.GenerateRSS(c, db) if err != nil { log.Println(err)