summaryrefslogtreecommitdiffstats
path: root/tpl/partials/integration_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'tpl/partials/integration_test.go')
-rw-r--r--tpl/partials/integration_test.go28
1 files changed, 28 insertions, 0 deletions
diff --git a/tpl/partials/integration_test.go b/tpl/partials/integration_test.go
index fcebe6c05..3dbaf2ce4 100644
--- a/tpl/partials/integration_test.go
+++ b/tpl/partials/integration_test.go
@@ -324,3 +324,31 @@ timeout = '200ms'
b.Assert(err.Error(), qt.Contains, "timed out")
}
+
+// See Issue #10789
+func TestReturnExecuteFromTemplateInPartial(t *testing.T) {
+ t.Parallel()
+
+ files := `
+-- config.toml --
+baseURL = 'http://example.com/'
+-- layouts/index.html --
+{{ $r := partial "foo" }}
+FOO:{{ $r.Content }}
+-- layouts/partials/foo.html --
+{{ $r := §§{{ partial "bar" }}§§ | resources.FromString "bar.html" | resources.ExecuteAsTemplate "bar.html" . }}
+{{ return $r }}
+-- layouts/partials/bar.html --
+BAR
+ `
+
+ b := hugolib.NewIntegrationTestBuilder(
+ hugolib.IntegrationTestConfig{
+ T: t,
+ TxtarString: files,
+ },
+ ).Build()
+
+ b.AssertFileContent("public/index.html", "OO:BAR")
+
+}