diff options
Diffstat (limited to 'hugolib/pages_capture.go')
-rw-r--r-- | hugolib/pages_capture.go | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/hugolib/pages_capture.go b/hugolib/pages_capture.go index 96c2c0f96..f175895c4 100644 --- a/hugolib/pages_capture.go +++ b/hugolib/pages_capture.go @@ -143,13 +143,29 @@ func (c *pagesCollector) Collect() (collectErr error) { s.pageMap.cfg.isRebuild = true } + var hasStructuralChange bool + for _, id := range c.ids { + if id.isStructuralChange() { + hasStructuralChange = true + break + } + } + for _, id := range c.ids { if id.p.IsLeafBundle() { collectErr = c.collectDir( id.p, false, func(fim hugofs.FileMetaInfo) bool { - return true + if hasStructuralChange { + return true + } + fimp := fim.Meta().PathInfo + if fimp == nil { + return true + } + + return fimp.Path() == id.p.Path() }, ) } else if id.p.IsBranchBundle() { |