From 8a4e1b65203f9fad6df978b607eab2249f494166 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Thu, 27 Jul 2017 13:30:46 +0100 Subject: [PATCH] Don't throw error if it is not a draft --- caddy/hugo/hugo.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/caddy/hugo/hugo.go b/caddy/hugo/hugo.go index b20852cd..a39077f1 100644 --- a/caddy/hugo/hugo.go +++ b/caddy/hugo/hugo.go @@ -110,7 +110,7 @@ func (h hugo) BeforeAPI(c *filemanager.RequestContext, w http.ResponseWriter, r // We only run undraft command if it is a file. if !strings.HasSuffix(filename, "/") { args := []string{"undraft", filename} - if err := Run(h.Exe, args, h.Root); err != nil { + if err := Run(h.Exe, args, h.Root); err != nil && !strings.Contains(err.Error(), "not a Draft") { return http.StatusInternalServerError, err } }