aboutsummaryrefslogtreecommitdiffhomepage
path: root/hugolib/content_map_page.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2024-02-06 20:26:18 +0100
committerBjørn Erik Pedersen <[email protected]>2024-02-06 21:53:33 +0100
commita65622a13e2f20fc8746ccdc89cc6a731635a29e (patch)
treed27ce5609ee36688877d8dee521d91ca72034964 /hugolib/content_map_page.go
parent146aedd7aa74654ead8afce01f63c0756bc31e71 (diff)
downloadhugo-a65622a13e2f20fc8746ccdc89cc6a731635a29e.tar.gz
hugo-a65622a13e2f20fc8746ccdc89cc6a731635a29e.zip
Fix rebuild of changed bundled content files
Fixes #12000
Diffstat (limited to 'hugolib/content_map_page.go')
-rw-r--r--hugolib/content_map_page.go18
1 files changed, 17 insertions, 1 deletions
diff --git a/hugolib/content_map_page.go b/hugolib/content_map_page.go
index 75863acbd..43c67ce73 100644
--- a/hugolib/content_map_page.go
+++ b/hugolib/content_map_page.go
@@ -127,7 +127,22 @@ type pageTrees struct {
// collectIdentities collects all identities from in all trees matching the given key.
// This will at most match in one tree, but may give identies from multiple dimensions (e.g. language).
-func (t *pageTrees) collectIdentities(key string) []identity.Identity {
+func (t *pageTrees) collectIdentities(p *paths.Path) []identity.Identity {
+ ids := t.collectIdentitiesFor(p.Base())
+
+ if p.Component() == files.ComponentFolderContent {
+ // It may also be a bundled content resource.
+ if n := t.treeResources.Get(p.ForBundleType(paths.PathTypeContentResource).Base()); n != nil {
+ n.ForEeachIdentity(func(id identity.Identity) bool {
+ ids = append(ids, id)
+ return false
+ })
+ }
+ }
+ return ids
+}
+
+func (t *pageTrees) collectIdentitiesFor(key string) []identity.Identity {
var ids []identity.Identity
if n := t.treePages.Get(key); n != nil {
n.ForEeachIdentity(func(id identity.Identity) bool {
@@ -135,6 +150,7 @@ func (t *pageTrees) collectIdentities(key string) []identity.Identity {
return false
})
}
+
if n := t.treeResources.Get(key); n != nil {
n.ForEeachIdentity(func(id identity.Identity) bool {
ids = append(ids, id)