mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-30 22:39:58 +02:00
Fix sample logic when adding content files in server
The partial rebuilds works by calaulating a baseline from a change set. For new content, this doesn't work, so to avoid rebuilding everything, we first try to collect a sample of surrounding identities (e.g. content files in the same section). This commit fixes a flaw in that logic that in some (many...) cases would return a too small sample set. Fixes #12054
This commit is contained in:
@@ -192,7 +192,7 @@ func (t *pageTrees) collectIdentitiesSurroundingIn(key string, maxSamples int, t
|
||||
level := strings.Count(prefix, "/")
|
||||
tree.WalkPrefixRaw(prefix, func(s string, n contentNodeI) bool {
|
||||
if level != strings.Count(s, "/") {
|
||||
return true
|
||||
return false
|
||||
}
|
||||
n.ForEeachIdentity(func(id identity.Identity) bool {
|
||||
ids = append(ids, id)
|
||||
|
Reference in New Issue
Block a user