Fix data race in non-renderable pages

Fixes #1601
This commit is contained in:
Bjørn Erik Pedersen
2015-12-18 09:54:46 +01:00
parent 0c01fef321
commit 8cea428802
3 changed files with 28 additions and 18 deletions

View File

@@ -66,6 +66,7 @@ type Page struct {
contentType string
renderable bool
Layout string
layoutsCalculated []string
linkTitle string
frontmatter []byte
rawContent []byte
@@ -288,6 +289,10 @@ func (p *Page) Section() string {
}
func (p *Page) layouts(l ...string) []string {
if len(p.layoutsCalculated) > 0 {
return p.layoutsCalculated
}
if p.Layout != "" {
return layouts(p.Type(), p.Layout)
}