mirror of
https://github.com/gohugoio/hugo.git
synced 2025-03-21 02:42:49 +00:00
parent
58c446f562
commit
c5f40e8b8b
1 changed files with 6 additions and 3 deletions
|
@ -345,12 +345,12 @@ Loop:
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(bep) Refactor/rename this lock strategy
|
// TODO(bep) Refactor/rename this lock strategy
|
||||||
isInnerShortcodeCache.Lock()
|
isInnerShortcodeCache.RLock()
|
||||||
if tmpl.Tree == nil {
|
if tmpl.Tree == nil {
|
||||||
isInnerShortcodeCache.Unlock()
|
isInnerShortcodeCache.RUnlock()
|
||||||
return sc, fmt.Errorf("Template for shortcode '%s' failed to compile for page '%s'", sc.name, p.BaseFileName())
|
return sc, fmt.Errorf("Template for shortcode '%s' failed to compile for page '%s'", sc.name, p.BaseFileName())
|
||||||
}
|
}
|
||||||
isInnerShortcodeCache.Unlock()
|
isInnerShortcodeCache.RUnlock()
|
||||||
isInner = isInnerShortcode(tmpl)
|
isInner = isInnerShortcode(tmpl)
|
||||||
|
|
||||||
case tScParam:
|
case tScParam:
|
||||||
|
@ -523,6 +523,9 @@ func renderShortcodeWithPage(tmpl *template.Template, data *ShortcodeWithPage) s
|
||||||
buffer := bp.GetBuffer()
|
buffer := bp.GetBuffer()
|
||||||
defer bp.PutBuffer(buffer)
|
defer bp.PutBuffer(buffer)
|
||||||
|
|
||||||
|
// TODO(bep) Refactor/rename this lock strategy
|
||||||
|
isInnerShortcodeCache.Lock()
|
||||||
|
defer isInnerShortcodeCache.Unlock()
|
||||||
err := tmpl.Execute(buffer, data)
|
err := tmpl.Execute(buffer, data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
jww.ERROR.Println("error processing shortcode", tmpl.Name(), "\n ERR:", err)
|
jww.ERROR.Println("error processing shortcode", tmpl.Name(), "\n ERR:", err)
|
||||||
|
|
Loading…
Reference in a new issue