mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
Add render template hooks for links and images
This commit also * revises the change detection for templates used by content files in server mode. * Adds a Page.RenderString method Fixes #6545 Fixes #4663 Closes #6043
This commit is contained in:
@@ -1459,3 +1459,19 @@ other = %q
|
||||
|
||||
return &multiSiteTestBuilder{sitesBuilder: b, configFormat: configFormat, config: config, configData: configData}
|
||||
}
|
||||
|
||||
func TestRebuildOnAssetChange(t *testing.T) {
|
||||
b := newTestSitesBuilder(t).Running()
|
||||
b.WithTemplatesAdded("index.html", `
|
||||
{{ (resources.Get "data.json").Content }}
|
||||
`)
|
||||
b.WithSourceFile("assets/data.json", "orig data")
|
||||
|
||||
b.Build(BuildCfg{})
|
||||
b.AssertFileContent("public/index.html", `orig data`)
|
||||
|
||||
b.EditFiles("assets/data.json", "changed data")
|
||||
|
||||
b.Build(BuildCfg{})
|
||||
b.AssertFileContent("public/index.html", `changed data`)
|
||||
}
|
||||
|
Reference in New Issue
Block a user