tpl/tplimpl: Create an embedded comment shortcode

Closes #13010
This commit is contained in:
Joe Mooring 2024-11-04 11:11:46 -08:00 committed by Bjørn Erik Pedersen
parent b7861e586e
commit 801035bb7a
2 changed files with 17 additions and 0 deletions

View file

@ -0,0 +1 @@
{{- $noop := .Inner -}}

View file

@ -584,3 +584,19 @@ title: p5
`<meta name="twitter:description" content="m n and **o** can&#39;t.">`,
)
}
func TestCommentShortcode(t *testing.T) {
t.Parallel()
files := `
-- hugo.toml --
disableKinds = ['page','rss','section','sitemap','taxonomy','term']
-- layouts/index.html --
{{ .Content }}
-- content/_index.md --
a{{< comment >}}b{{< /comment >}}c
`
b := hugolib.Test(t, files)
b.AssertFileContent("public/index.html", "<p>ac</p>")
}