mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-28 06:30:33 +03:00
parent
20f2211fce
commit
19e12caf8c
4 changed files with 62 additions and 13 deletions
|
@ -372,3 +372,30 @@ RSTART:<em>italic org mode</em>:REND
|
|||
`)
|
||||
|
||||
}
|
||||
|
||||
// https://github.com/gohugoio/hugo/issues/6882
|
||||
func TestRenderStringOnListPage(t *testing.T) {
|
||||
renderStringTempl := `
|
||||
{{ .RenderString "**Hello**" }}
|
||||
`
|
||||
b := newTestSitesBuilder(t)
|
||||
b.WithContent("mysection/p1.md", `FOO`)
|
||||
b.WithTemplates(
|
||||
"index.html", renderStringTempl,
|
||||
"_default/list.html", renderStringTempl,
|
||||
"_default/single.html", renderStringTempl,
|
||||
)
|
||||
|
||||
b.Build(BuildCfg{})
|
||||
|
||||
for _, filename := range []string{
|
||||
"index.html",
|
||||
"mysection/index.html",
|
||||
"categories/index.html",
|
||||
"tags/index.html",
|
||||
"mysection/p1/index.html",
|
||||
} {
|
||||
b.AssertFileContent("public/"+filename, `<strong>Hello</strong>`)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue