aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJoe Mooring <[email protected]>2024-11-04 11:11:46 -0800
committerBjørn Erik Pedersen <[email protected]>2024-11-04 21:05:07 +0100
commit801035bb7a38beae214105e872a4cdc49ac610ce (patch)
tree0b5d62b8b59a6295c582dece5c70f5efd1434467
parentb7861e586eb3e35c56ff0580de244f939596f7f4 (diff)
downloadhugo-801035bb7a38beae214105e872a4cdc49ac610ce.tar.gz
hugo-801035bb7a38beae214105e872a4cdc49ac610ce.zip
tpl/tplimpl: Create an embedded comment shortcode
Closes #13010
-rw-r--r--tpl/tplimpl/embedded/templates/shortcodes/comment.html1
-rw-r--r--tpl/tplimpl/tplimpl_integration_test.go16
2 files changed, 17 insertions, 0 deletions
diff --git a/tpl/tplimpl/embedded/templates/shortcodes/comment.html b/tpl/tplimpl/embedded/templates/shortcodes/comment.html
new file mode 100644
index 000000000..cb3293401
--- /dev/null
+++ b/tpl/tplimpl/embedded/templates/shortcodes/comment.html
@@ -0,0 +1 @@
+{{- $noop := .Inner -}}
diff --git a/tpl/tplimpl/tplimpl_integration_test.go b/tpl/tplimpl/tplimpl_integration_test.go
index a8599bbad..c7e118e82 100644
--- a/tpl/tplimpl/tplimpl_integration_test.go
+++ b/tpl/tplimpl/tplimpl_integration_test.go
@@ -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>")
+}