mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
@@ -566,6 +566,24 @@ title: P1
|
||||
|
||||
}
|
||||
|
||||
func TestTemplateGoIssues(t *testing.T) {
|
||||
b := newTestSitesBuilder(t)
|
||||
|
||||
b.WithTemplatesAdded(
|
||||
"index.html", `
|
||||
{{ $title := "a & b" }}
|
||||
<script type="application/ld+json">{"@type":"WebPage","headline":"{{$title}}"}</script>
|
||||
`,
|
||||
)
|
||||
|
||||
b.Build(BuildCfg{})
|
||||
|
||||
b.AssertFileContent("public/index.html", `
|
||||
<script type="application/ld+json">{"@type":"WebPage","headline":"a \u0026 b"}</script>
|
||||
|
||||
`)
|
||||
}
|
||||
|
||||
func collectIdentities(set map[identity.Identity]bool, provider identity.Provider) {
|
||||
if ids, ok := provider.(identity.IdentitiesProvider); ok {
|
||||
for _, id := range ids.GetIdentities() {
|
||||
|
Reference in New Issue
Block a user