mirror of
https://github.com/caddyserver/caddy.git
synced 2025-01-27 23:03:37 -05:00
markdown: report errors during initial sitegen
This commit is contained in:
parent
0ac8bf58ea
commit
e63b83c8c4
1 changed files with 6 additions and 2 deletions
|
@ -48,7 +48,8 @@ func Markdown(c *Controller) (middleware.Middleware, error) {
|
|||
}
|
||||
|
||||
fp := filepath.Join(md.Root, cfg.PathScope)
|
||||
filepath.Walk(fp, func(path string, info os.FileInfo, err error) error {
|
||||
|
||||
err = filepath.Walk(fp, func(path string, info os.FileInfo, err error) error {
|
||||
for _, ext := range cfg.Extensions {
|
||||
if !info.IsDir() && strings.HasSuffix(info.Name(), ext) {
|
||||
// Load the file
|
||||
|
@ -75,9 +76,12 @@ func Markdown(c *Controller) (middleware.Middleware, error) {
|
|||
break // don't try other file extensions
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
Loading…
Add table
Reference in a new issue