// This needs no reset, so no need to check it.
return nil
}
+
// First check the top level dependency manager.
for _, id := range changes {
checkedCounter.Add(1)
views = sa.pageMap.cfg.taxonomyConfig.views
)
+ rebuild := sa.s.h.isRebuild()
+
lockType := doctree.LockTypeWrite
w := &doctree.NodeShiftTreeWalker[contentNodeI]{
Tree: pages,
pi := sa.Site.Conf.PathParser().Parse(files.ComponentFolderContent, viewTermKey+"/_index.md")
term := pages.Get(pi.Base())
if term == nil {
+ if rebuild {
+ // A new tag was added in server mode.
+ taxonomy := pages.Get(viewName.pluralTreeKey)
+ if taxonomy != nil {
+ sa.assembleChanges.Add(taxonomy.GetIdentity())
+ }
+ }
+
m := &pageMeta{
term: v,
singular: viewName.singular,
}
}
+ // Handle new terms from assemblePagesStep2.
+ changes = bcfg.WhatChanged.Drain()
+ if len(changes) > 0 {
+ if err := h.resolveAndClearStateForIdentities(ctx, l, nil, changes); err != nil {
+ return err
+ }
+ }
+
h.renderFormats = output.Formats{}
for _, s := range h.Sites {
s.s.initRenderFormats()
b.EditFileReplaceAll("content/p1/index.md", "p1-content", "p1-content-foo").Build()
b.AssertFileContent("public/p1/index.html", "p1-content-foo")
}
+
+func TestRebuildEditTagIssue13648(t *testing.T) {
+ t.Parallel()
+
+ files := `
+-- hugo.toml --
+baseURL = "https://example.com"
+disableLiveReload = true
+-- layouts/all.html --
+All. {{ range .Pages }}{{ .Title }}|{{ end }}
+-- content/p1.md --
+---
+title: "P1"
+tags: ["tag1"]
+---
+
+`
+ b := TestRunning(t, files)
+
+ b.AssertFileContent("public/tags/index.html", "All. Tag1|")
+ b.EditFileReplaceAll("content/p1.md", "tag1", "tag2").Build()
+
+ // Note that the below is still not correct, as this is effectively a rename, and
+ // Tag2 should be removed from the list.
+ // But that is a harder problem to tackle.
+ b.AssertFileContent("public/tags/index.html", "All. Tag1|Tag2|")
+}