filebrowser/hugo.go
2016-06-21 16:01:46 +01:00

30 lines
898 B
Go

//go:generate go get github.com/jteeuwen/go-bindata
//go:generate go install github.com/jteeuwen/go-bindata/go-bindata
//go:generate go-bindata -pkg hugo -prefix "assets" -o binary.go assets/...
// Package hugo makes the bridge between the static website generator Hugo
// and the webserver Caddy, also providing an administrative user interface.
package hugo
import (
"net/http"
"github.com/hacdias/caddy-filemanager"
"github.com/mholt/caddy/caddyhttp/httpserver"
)
// Hugo contais the next middleware to be run and the configuration
// of the current one.
type Hugo struct {
FileManager *filemanager.FileManager
Next httpserver.Handler
Config *Config
}
// ServeHTTP is the main function of the whole plugin that routes every single
// request to its function.
func (h Hugo) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error) {
return h.Next.ServeHTTP(w, r)
}