Some updates
This commit is contained in:
5 files changed
+133
-36
No files matched your search
+12
-5
@@ -18,7 +18,8 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
errHugoNotFound = errors.New("It seems that tou don't have 'hugo' on your PATH")
|
||||
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")
|
||||
)
|
||||
|
||||
// setup configures a new FileManager middleware instance.
|
||||
@@ -125,10 +126,6 @@ func parse(c *caddy.Controller) ([]*filemanager.FileManager, error) {
|
||||
Public: filepath.Join(directory, "public"),
|
||||
Args: []string{},
|
||||
CleanPublic: true,
|
||||
Commands: map[string][]string{
|
||||
"before_publish": []string{},
|
||||
"after_publish": []string{},
|
||||
},
|
||||
}
|
||||
|
||||
// Try to find the Hugo executable path.
|
||||
@@ -141,6 +138,16 @@ func parse(c *caddy.Controller) ([]*filemanager.FileManager, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
err = m.RegisterEventType("before_publish")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
err = m.RegisterEventType("after_publish")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
m.SetBaseURL(admin)
|
||||
m.SetPrefixURL(strings.TrimSuffix(caddyConf.Addr.Path, "/"))
|
||||
configs = append(configs, m)
|
||||
|
||||
Reference in new issue
Block a user