mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-15 20:44:01 +02:00
Print layout name if it was specified when showing missing layout file error
Fixes #7617
This commit is contained in:
@@ -130,7 +130,7 @@ func pageRenderer(
|
||||
}
|
||||
|
||||
if !found {
|
||||
s.logMissingLayout("", p.Kind(), p.f.Name)
|
||||
s.logMissingLayout("", p.Layout(), p.Kind(), p.f.Name)
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ func pageRenderer(
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Site) logMissingLayout(name, kind, outputFormat string) {
|
||||
func (s *Site) logMissingLayout(name, layout, kind, outputFormat string) {
|
||||
log := s.Log.WARN
|
||||
if name != "" && infoOnMissingLayout[name] {
|
||||
log = s.Log.INFO
|
||||
@@ -162,6 +162,11 @@ func (s *Site) logMissingLayout(name, kind, outputFormat string) {
|
||||
args = append(args, outputFormat)
|
||||
}
|
||||
|
||||
if layout != "" {
|
||||
msg += " for layout %q"
|
||||
args = append(args, layout)
|
||||
}
|
||||
|
||||
if kind != "" {
|
||||
msg += " for kind %q"
|
||||
args = append(args, kind)
|
||||
|
Reference in New Issue
Block a user