From 766c82a6bbf4423a037beb2b1967f720080e4658 Mon Sep 17 00:00:00 2001 From: "C. Hoeppler" Date: Thu, 13 Oct 2016 10:30:43 +0200 Subject: Add context to asciidoc/-tor error logging Add DocumentName (path to the file being rendered) to RenderingContext and use that information to include the path in the error print. See #2399 Closes #2567 --- hugolib/shortcode.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'hugolib/shortcode.go') diff --git a/hugolib/shortcode.go b/hugolib/shortcode.go index 88c06baf5..0b583b753 100644 --- a/hugolib/shortcode.go +++ b/hugolib/shortcode.go @@ -243,7 +243,9 @@ func renderShortcode(sc shortcode, parent *ShortcodeWithPage, p *Page, t tpl.Tem newInner := helpers.RenderBytes(&helpers.RenderingContext{ Content: []byte(inner), PageFmt: p.determineMarkupType(), ConfigProvider: p.Language(), - DocumentID: p.UniqueID(), Config: p.getRenderingConfig()}) + DocumentID: p.UniqueID(), + DocumentName: p.Path(), + Config: p.getRenderingConfig()}) // If the type is “unknown” or “markdown”, we assume the markdown // generation has been performed. Given the input: `a line`, markdown -- cgit v1.2.3