Fix Hugo error
parent
9ca6ef1f3e
commit
c0b60d5928
|
@ -18,6 +18,8 @@ import (
|
||||||
|
|
||||||
// setup configures a new FileManager middleware instance.
|
// setup configures a new FileManager middleware instance.
|
||||||
func setup(c *caddy.Controller) error {
|
func setup(c *caddy.Controller) error {
|
||||||
|
plugins.RegisterHugo()
|
||||||
|
|
||||||
configs, err := parse(c)
|
configs, err := parse(c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
@ -76,6 +76,8 @@ func setupViper() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
plugins.RegisterHugo()
|
||||||
|
|
||||||
setupViper()
|
setupViper()
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,12 @@ import (
|
||||||
"github.com/robfig/cron"
|
"github.com/robfig/cron"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
var (
|
||||||
|
ErrHugoNotFound = errors.New("It seems that tou don't have 'hugo' on your PATH")
|
||||||
|
ErrUnsupportedFileType = errors.New("The type of the provided file isn't supported for this action")
|
||||||
|
)
|
||||||
|
|
||||||
|
func RegisterHugo() {
|
||||||
filemanager.RegisterPlugin("hugo", filemanager.Plugin{
|
filemanager.RegisterPlugin("hugo", filemanager.Plugin{
|
||||||
JavaScript: rice.MustFindBox("./assets/").MustString("hugo.js"),
|
JavaScript: rice.MustFindBox("./assets/").MustString("hugo.js"),
|
||||||
CommandEvents: []string{"before_publish", "after_publish"},
|
CommandEvents: []string{"before_publish", "after_publish"},
|
||||||
|
@ -30,11 +35,6 @@ func init() {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
|
||||||
ErrHugoNotFound = errors.New("It seems that tou don't have 'hugo' on your PATH")
|
|
||||||
ErrUnsupportedFileType = errors.New("The type of the provided file isn't supported for this action")
|
|
||||||
)
|
|
||||||
|
|
||||||
// Hugo is a hugo (https://gohugo.io) plugin.
|
// Hugo is a hugo (https://gohugo.io) plugin.
|
||||||
type Hugo struct {
|
type Hugo struct {
|
||||||
// Website root
|
// Website root
|
||||||
|
|
Loading…
Reference in New Issue