mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-23 21:53:09 +02:00
Fix it so the owning taxonomy gets rerendered in server when new tags are added
Updates #13648
This commit is contained in:
@@ -1865,3 +1865,30 @@ p1-content|
|
||||
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|")
|
||||
}
|
||||
|
Reference in New Issue
Block a user