mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-27 22:21:07 +03:00
tpl: Fix race condition in text template baseof
Copy most of the htmltemplate cloning to the textemplate implementation in the same function.
This commit is contained in:
parent
e19a046c4b
commit
241b7483ea
1 changed files with 7 additions and 1 deletions
|
@ -598,10 +598,16 @@ func (t *templateHandler) applyBaseTemplate(overlay, base templateInfo) (tpl.Tem
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
templ, err = templ.Parse(overlay.template)
|
templ, err = texttemplate.Must(templ.Clone()).Parse(overlay.template)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, overlay.errWithFileContext("parse failed", err)
|
return nil, overlay.errWithFileContext("parse failed", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The extra lookup is a workaround, see
|
||||||
|
// * https://github.com/golang/go/issues/16101
|
||||||
|
// * https://github.com/gohugoio/hugo/issues/2549
|
||||||
|
// templ = templ.Lookup(templ.Name())
|
||||||
|
|
||||||
return templ, nil
|
return templ, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue