"testing"
qt "github.com/frankban/quicktest"
+ "github.com/gohugoio/hugo/common/loggers"
)
func TestRenderHookEditNestedPartial(t *testing.T) {
b.AssertFileContent("public/"+filename, `<strong>Hello</strong>`)
}
}
+
+// Issue 9433
+func TestRenderStringOnPageNotBackedByAFile(t *testing.T) {
+ t.Parallel()
+ logger := loggers.NewWarningLogger()
+ b := newTestSitesBuilder(t).WithLogger(logger).WithConfigFile("toml", `
+disableKinds = ["page", "section", "taxonomy", "term"]
+`)
+ b.WithTemplates("index.html", `{{ .RenderString "**Hello**" }}`).WithContent("p1.md", "")
+ b.BuildE(BuildCfg{})
+ b.Assert(int(logger.LogCounters().WarnCounter.Count()), qt.Equals, 0)
+}
var id string
var filename string
+ var path string
if !p.f.IsZero() {
id = p.f.UniqueID()
filename = p.f.Filename()
+ path = p.f.Path()
+ } else {
+ path = p.Pathc()
}
cpp, err := cp.New(
converter.DocumentContext{
Document: newPageForRenderHook(ps),
DocumentID: id,
- DocumentName: p.File().Path(),
+ DocumentName: path,
Filename: filename,
ConfigOverrides: renderingConfigOverrides,
},