hugolib: Fix .Sections vs siblings

Fixes #6365
This commit is contained in:
Bjørn Erik Pedersen 2019-11-26 13:12:44 +01:00
parent 96f09659ce
commit da53523599
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F
2 changed files with 2 additions and 2 deletions

View file

@ -176,8 +176,6 @@ func (m *pagesMap) addPage(p *pageState) {
} }
bucket = v.(*pagesMapBucket) bucket = v.(*pagesMapBucket)
p.bucket = bucket
bucket.pages = append(bucket.pages, p) bucket.pages = append(bucket.pages, p)
} }

View file

@ -321,6 +321,8 @@ PAG|{{ .Title }}|{{ $sect.InSection . }}
rootPage := s.getPage(page.KindPage, "mypage.md") rootPage := s.getPage(page.KindPage, "mypage.md")
c.Assert(rootPage, qt.Not(qt.IsNil)) c.Assert(rootPage, qt.Not(qt.IsNil))
c.Assert(rootPage.Parent().IsHome(), qt.Equals, true) c.Assert(rootPage.Parent().IsHome(), qt.Equals, true)
// https://github.com/gohugoio/hugo/issues/6365
c.Assert(rootPage.Sections(), qt.HasLen, 0)
// Add a odd test for this as this looks a little bit off, but I'm not in the mood // Add a odd test for this as this looks a little bit off, but I'm not in the mood
// to think too hard a out this right now. It works, but people will have to spell // to think too hard a out this right now. It works, but people will have to spell