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:
@ -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{
|
||||
|
Reference in New Issue
Block a user