diff options
author | Bjørn Erik Pedersen <[email protected]> | 2024-03-13 17:03:16 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2024-03-13 19:35:28 +0200 |
commit | 9ca1de09dd397a84dd13e528d8d09930d913d885 (patch) | |
tree | 7c6c5cd73b0e55f52b283a6e85a5b4366bac9ed8 /hugolib/rebuild_test.go | |
parent | e62675002e1b20488709a9a2befae28fa2d0726e (diff) | |
download | hugo-9ca1de09dd397a84dd13e528d8d09930d913d885.tar.gz hugo-9ca1de09dd397a84dd13e528d8d09930d913d885.zip |
Fix panic when changing archetype files when servere is running
Fixes #12195
Diffstat (limited to 'hugolib/rebuild_test.go')
-rw-r--r-- | hugolib/rebuild_test.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/hugolib/rebuild_test.go b/hugolib/rebuild_test.go index 98a8d0949..f3b10cf18 100644 --- a/hugolib/rebuild_test.go +++ b/hugolib/rebuild_test.go @@ -1472,3 +1472,21 @@ all: {{ $ab.RelPermalink }} b.AddFiles("assets/common/c3.css", "c3").Build() b.AssertFileContent("public/ab.css", "abc1c2 editedc3") } + +func TestRebuildEditArchetypeFile(t *testing.T) { + t.Parallel() + + files := ` +-- hugo.toml -- +baseURL = "https://example.com" +disableLiveReload = true +-- archetypes/default.md -- +--- +title: "Default" +--- +` + + b := TestRunning(t, files) + // Just make sure that it doesn't panic. + b.EditFileReplaceAll("archetypes/default.md", "Default", "Default Edited").Build() +} |