From: Bjørn Erik Pedersen Date: Tue, 26 Nov 2019 12:12:44 +0000 (+0100) Subject: hugolib: Fix .Sections vs siblings X-Git-Tag: v0.60.0~11 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=da53523599b43261520a22d77019b390aaa072e7;p=brevno-suite%2Fhugo hugolib: Fix .Sections vs siblings Fixes #6365 --- diff --git a/hugolib/pages_map.go b/hugolib/pages_map.go index b5b47cca..bc858914 100644 --- a/hugolib/pages_map.go +++ b/hugolib/pages_map.go @@ -176,8 +176,6 @@ func (m *pagesMap) addPage(p *pageState) { } bucket = v.(*pagesMapBucket) - p.bucket = bucket - bucket.pages = append(bucket.pages, p) } diff --git a/hugolib/site_sections_test.go b/hugolib/site_sections_test.go index 3cd2a06b..eba8a439 100644 --- a/hugolib/site_sections_test.go +++ b/hugolib/site_sections_test.go @@ -321,6 +321,8 @@ PAG|{{ .Title }}|{{ $sect.InSection . }} rootPage := s.getPage(page.KindPage, "mypage.md") c.Assert(rootPage, qt.Not(qt.IsNil)) 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 // to think too hard a out this right now. It works, but people will have to spell