mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-26 22:04:32 +02:00
Misc remote HTTP/content adapter enhancements
* Recover from server errors * Improve go adapter rebuilds when adding new content See #12502 Fixes #12570
This commit is contained in:
@@ -386,6 +386,21 @@ func (m *pageMap) addPagesFromGoTmplFi(fi hugofs.FileMetaInfo, buildConfig *Buil
|
||||
pt.AddChange(n.GetIdentity())
|
||||
} else {
|
||||
pt.AddChange(u.GetIdentity())
|
||||
// New content not in use anywhere.
|
||||
// To make sure that these gets listed in any site.RegularPages ranges or similar
|
||||
// we could invalidate everything, but first try to collect a sample set
|
||||
// from the surrounding pages.
|
||||
var surroundingIDs []identity.Identity
|
||||
ids := h.pageTrees.collectIdentitiesSurrounding(pi.Base(), 10)
|
||||
if len(ids) > 0 {
|
||||
surroundingIDs = append(surroundingIDs, ids...)
|
||||
} else {
|
||||
// No surrounding pages found, so invalidate everything.
|
||||
surroundingIDs = []identity.Identity{identity.GenghisKhan}
|
||||
}
|
||||
for _, id := range surroundingIDs {
|
||||
pt.AddChange(id)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user