aboutsummaryrefslogtreecommitdiffhomepage
path: root/hugolib/rebuild_test.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2024-04-30 18:25:55 +0200
committerBjørn Erik Pedersen <[email protected]>2024-04-30 20:57:44 +0200
commit9dd687027f2b37bdb94d51fed403066b9f7b9a45 (patch)
tree3b55aa302caa9c4f21cbd4e9aa310c875478037c /hugolib/rebuild_test.go
parent196132753649e6e714f05c83122737cabd0da310 (diff)
downloadhugo-9dd687027f2b37bdb94d51fed403066b9f7b9a45.tar.gz
hugo-9dd687027f2b37bdb94d51fed403066b9f7b9a45.zip
Make sure replaced pages gets marked as stale
Fixes #12436
Diffstat (limited to 'hugolib/rebuild_test.go')
-rw-r--r--hugolib/rebuild_test.go36
1 files changed, 36 insertions, 0 deletions
diff --git a/hugolib/rebuild_test.go b/hugolib/rebuild_test.go
index 4336d8b61..a847af3af 100644
--- a/hugolib/rebuild_test.go
+++ b/hugolib/rebuild_test.go
@@ -1585,3 +1585,39 @@ title: p1
b.AddFiles("content/p2.md", "---\ntitle: p2\n---").Build()
b.AssertFileContent("public/index.html", "p1|p2|") // this test passes, which doesn't match reality
}
+
+func TestRebuildHomeThenPageIssue12436(t *testing.T) {
+ t.Parallel()
+
+ files := `
+-- hugo.toml --
+baseURL = "https://example.com"
+disableKinds = ['sitemap','taxonomy','term']
+disableLiveReload = true
+-- layouts/_default/list.html --
+{{ .Content }}
+-- layouts/_default/single.html --
+{{ .Content }}
+-- content/_index.md --
+---
+title: home
+---
+home-content|
+-- content/p1/index.md --
+---
+title: p1
+---
+p1-content|
+`
+
+ b := TestRunning(t, files)
+
+ b.AssertFileContent("public/index.html", "home-content|")
+ b.AssertFileContent("public/p1/index.html", "p1-content|")
+
+ b.EditFileReplaceAll("content/_index.md", "home-content", "home-content-foo").Build()
+ b.AssertFileContent("public/index.html", "home-content-foo")
+
+ b.EditFileReplaceAll("content/p1/index.md", "p1-content", "p1-content-foo").Build()
+ b.AssertFileContent("public/p1/index.html", "p1-content-foo")
+}