Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2019-11-10 15:36:33 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2019-11-10 20:57:31 +0300
commitd1d1f240a25945b37eebe8a9a3f439f290832b33 (patch)
treed15f75056a9a7246b37895642f34f5874dab4981 /hugolib/pages_map.go
parent70a1aa345b95bcf325f19c6e7184bcd6f885e454 (diff)
hubolib: Headless bundles should not be listed in .Pages
Fixes #6492
Diffstat (limited to 'hugolib/pages_map.go')
-rw-r--r--hugolib/pages_map.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/hugolib/pages_map.go b/hugolib/pages_map.go
index c7a74c4c1..aba1aa4bf 100644
--- a/hugolib/pages_map.go
+++ b/hugolib/pages_map.go
@@ -107,7 +107,12 @@ func (m *pagesMap) initPageMetaFor(prefix string, bucket *pagesMapBucket) error
tmp := bucket.pages[:0]
for _, x := range bucket.pages {
if m.s.shouldBuild(x) {
- tmp = append(tmp, x)
+ if x.(*pageState).m.headless {
+ bucket.headlessPages = append(bucket.headlessPages, x)
+ } else {
+ tmp = append(tmp, x)
+ }
+
}
}
bucket.pages = tmp
@@ -410,8 +415,9 @@ type pagesMapBucket struct {
parent *pagesMapBucket
bucketSections []*pagesMapBucket
- pagesInit sync.Once
- pages page.Pages
+ pagesInit sync.Once
+ pages page.Pages
+ headlessPages page.Pages
pagesAndSectionsInit sync.Once
pagesAndSections page.Pages