Fix rebuild of changed bundled content files

Fixes #12000
This commit is contained in:
Bjørn Erik Pedersen
2024-02-06 20:26:18 +01:00
parent 146aedd7aa
commit a65622a13e
5 changed files with 37 additions and 7 deletions

View File

@@ -39,7 +39,7 @@ My Section Bundle Text 2 Content.
---
title: "My Section Bundle Content"
---
My Section Bundle Content.
My Section Bundle Content Content.
-- content/mysection/_index.md --
---
title: "My Section"
@@ -68,7 +68,7 @@ Foo.
func TestRebuildEditTextFileInLeafBundle(t *testing.T) {
b := TestRunning(t, rebuildFilesSimple)
b.AssertFileContent("public/mysection/mysectionbundle/index.html",
"Resources: 0:/mysection/mysectionbundle/mysectionbundletext.txt|My Section Bundle Text 2 Content.|1:|<p>My Section Bundle Content.</p>\n|$")
"Resources: 0:/mysection/mysectionbundle/mysectionbundletext.txt|My Section Bundle Text 2 Content.|1:|<p>My Section Bundle Content Content.</p>\n|$")
b.EditFileReplaceAll("content/mysection/mysectionbundle/mysectionbundletext.txt", "Content.", "Content Edited.").Build()
b.AssertFileContent("public/mysection/mysectionbundle/index.html",
@@ -109,6 +109,13 @@ func TestRebuildRenameTextFileInLeafBundle(t *testing.T) {
b.AssertRenderCountContent(3)
}
func TestRebuilEditContentFileInLeafBundle(t *testing.T) {
b := TestRunning(t, rebuildFilesSimple)
b.AssertFileContent("public/mysection/mysectionbundle/index.html", "My Section Bundle Content Content.")
b.EditFileReplaceAll("content/mysection/mysectionbundle/mysectionbundlecontent.md", "Content Content.", "Content Content Edited.").Build()
b.AssertFileContent("public/mysection/mysectionbundle/index.html", "My Section Bundle Content Content Edited.")
}
func TestRebuildRenameTextFileInBranchBundle(t *testing.T) {
b := TestRunning(t, rebuildFilesSimple)
b.AssertFileContent("public/mysection/index.html", "My Section")