progresses on #41
This commit is contained in:
6
hugo.go
6
hugo.go
@@ -18,6 +18,7 @@ import (
|
||||
"github.com/hacdias/caddy-hugo/browse"
|
||||
"github.com/hacdias/caddy-hugo/config"
|
||||
"github.com/hacdias/caddy-hugo/editor"
|
||||
"github.com/hacdias/caddy-hugo/git"
|
||||
"github.com/hacdias/caddy-hugo/utils"
|
||||
"github.com/mholt/caddy/caddy/setup"
|
||||
"github.com/mholt/caddy/middleware"
|
||||
@@ -135,6 +136,11 @@ func (h CaddyHugo) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error
|
||||
code, err = editor.ServeHTTP(w, r, h.Config)
|
||||
}
|
||||
|
||||
// Git API
|
||||
if page == "edit" {
|
||||
code, err = git.ServeHTTP(w, r, h.Config)
|
||||
}
|
||||
|
||||
// Whenever the header "X-Regenerate" is true, the website should be
|
||||
// regenerated. Used in edit and settings, for example.
|
||||
if r.Header.Get("X-Regenerate") == "true" {
|
||||
|
||||
Reference in New Issue
Block a user