aboutsummaryrefslogtreecommitdiffhomepage
path: root/hugolib/site.go
diff options
context:
space:
mode:
Diffstat (limited to 'hugolib/site.go')
-rw-r--r--hugolib/site.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/hugolib/site.go b/hugolib/site.go
index f6dc89a77..7ec70eb6c 100644
--- a/hugolib/site.go
+++ b/hugolib/site.go
@@ -1493,7 +1493,11 @@ func (s *Site) renderForTemplate(ctx context.Context, name, outputFormat string,
}
if err = s.Tmpl().ExecuteWithContext(ctx, templ, w, d); err != nil {
- return fmt.Errorf("render of %q failed: %w", name, err)
+ filename := name
+ if p, ok := d.(*pageState); ok {
+ filename = p.String()
+ }
+ return fmt.Errorf("render of %q failed: %w", filename, err)
}
return
}