aboutsummaryrefslogtreecommitdiffhomepage
path: root/hugolib/site_render.go
diff options
context:
space:
mode:
authorAndreas Richter <[email protected]>2020-09-13 14:36:37 -0400
committerGitHub <[email protected]>2020-09-13 20:36:37 +0200
commit9df60b62f9c4e36a269f0c6e9a69bee9dc691031 (patch)
tree5f179bdfd4c20961377a4b893a6c74ea1a04ab21 /hugolib/site_render.go
parent4fad43c8bd528f1805e78c50cd2e33822351c183 (diff)
downloadhugo-9df60b62f9c4e36a269f0c6e9a69bee9dc691031.tar.gz
hugo-9df60b62f9c4e36a269f0c6e9a69bee9dc691031.zip
Print layout name if it was specified when showing missing layout file error
Fixes #7617
Diffstat (limited to 'hugolib/site_render.go')
-rw-r--r--hugolib/site_render.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/hugolib/site_render.go b/hugolib/site_render.go
index 88b5e6fb7..d9d60c2fa 100644
--- a/hugolib/site_render.go
+++ b/hugolib/site_render.go
@@ -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)