1
0
mirror of https://github.com/gohugoio/hugo.git synced 2024-05-11 05:54:58 +00:00

Improve error when we cannot determine content directory in "hugo new"

See #9166
This commit is contained in:
Bjørn Erik Pedersen
2021-11-15 10:25:30 +01:00
parent 08552a7a4c
commit b8155452ac
3 changed files with 20 additions and 13 deletions

View File

@ -60,7 +60,11 @@ func NewContent(h *hugolib.HugoSites, kind, targetPath string) error {
cf := hugolib.NewContentFactory(h)
if kind == "" {
kind = cf.SectionFromFilename(targetPath)
var err error
kind, err = cf.SectionFromFilename(targetPath)
if err != nil {
return err
}
}
b := &contentBuilder{