regenerate button working

This commit is contained in:
Henrique Dias
2016-06-28 22:20:42 +01:00
parent 380d4fb60c
commit 3dd946d0ca
2 changed files with 51 additions and 14 deletions

View File

@@ -74,8 +74,12 @@ func (h Hugo) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error) {
if directory.CanBeEdited(r.URL.Path) && r.Method == http.MethodPut {
code, err := h.FileManager.ServeHTTP(w, r)
if err != nil {
return code, err
}
if r.Header.Get("Regenerate") == "true" {
go RunHugo(h.Config, false)
RunHugo(h.Config, false)
}
if r.Header.Get("Schedule") != "" {