mirror of
https://github.com/danog/gojekyll.git
synced 2025-01-23 07:51:18 +01:00
Display filename for liquid render errors
This commit is contained in:
parent
242f33e498
commit
9ae0eae4c1
@ -89,8 +89,8 @@ func (p *Pipeline) renderTemplate(b []byte, e templates.VariableMap, filename st
|
|||||||
return b, err
|
return b, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// ApplyLayout applies the named layout to bytes.
|
// ApplyLayout applies the named layout to the data.
|
||||||
func (p *Pipeline) ApplyLayout(name string, b []byte, e templates.VariableMap) ([]byte, error) {
|
func (p *Pipeline) ApplyLayout(name string, data []byte, e templates.VariableMap) ([]byte, error) {
|
||||||
for name != "" {
|
for name != "" {
|
||||||
var lfm templates.VariableMap
|
var lfm templates.VariableMap
|
||||||
t, err := p.FindLayout(name, &lfm)
|
t, err := p.FindLayout(name, &lfm)
|
||||||
@ -98,16 +98,16 @@ func (p *Pipeline) ApplyLayout(name string, b []byte, e templates.VariableMap) (
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
le := templates.MergeVariableMaps(e, templates.VariableMap{
|
le := templates.MergeVariableMaps(e, templates.VariableMap{
|
||||||
"content": string(b),
|
"content": string(data),
|
||||||
"layout": lfm,
|
"layout": lfm,
|
||||||
})
|
})
|
||||||
b, err = t.Render(le)
|
data, err = t.Render(le)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, helpers.PathError(err, "render template", name)
|
||||||
}
|
}
|
||||||
name = lfm.String("layout", "")
|
name = lfm.String("layout", "")
|
||||||
}
|
}
|
||||||
return b, nil
|
return data, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *Pipeline) makeLocalLiquidEngine() liquid.Engine {
|
func (p *Pipeline) makeLocalLiquidEngine() liquid.Engine {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user