Skip to content

Commit

Permalink
tpl/tplimpl: Create an embedded comment shortcode
Browse files Browse the repository at this point in the history
Closes #13010
  • Loading branch information
jmooring authored and bep committed Nov 4, 2024
1 parent b7861e5 commit 801035b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions tpl/tplimpl/embedded/templates/shortcodes/comment.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{- $noop := .Inner -}}
16 changes: 16 additions & 0 deletions tpl/tplimpl/tplimpl_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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>")
}

0 comments on commit 801035b

Please sign in to comment.