summaryrefslogtreecommitdiffstats
path: root/hugolib/shortcode.go
diff options
context:
space:
mode:
authorC. Hoeppler <hoeppler@gmx.net>2016-10-13 10:30:43 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2016-10-13 13:48:43 +0200
commit766c82a6bbf4423a037beb2b1967f720080e4658 (patch)
tree443ea3cebd9f72ba23c2d1fb1d9350f4a8453bef /hugolib/shortcode.go
parent9f9b93af2c379b10d2d5c514cfe5f0658795b9bb (diff)
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
Diffstat (limited to 'hugolib/shortcode.go')
-rw-r--r--hugolib/shortcode.go4
1 files changed, 3 insertions, 1 deletions
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