]> git.maquefel.me Git - brevno-suite/hugo/commitdiff
tpl/tplimpl: Deprecate comment shortcode
authorJoe Mooring <joe.mooring@veriphor.com>
Wed, 22 Jan 2025 16:59:16 +0000 (08:59 -0800)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Wed, 22 Jan 2025 18:38:02 +0000 (19:38 +0100)
tpl/tplimpl/embedded/templates/shortcodes/comment.html
tpl/tplimpl/shortcodes_integration_test.go

index cb32934018ccce6f601d06985a5795c148921f1e..c35b5cad66071208322287ffbc500f745bd3de63 100644 (file)
@@ -1 +1,2 @@
+{{- warnf "The %q shortcode was deprecated in v0.143.0 and will be removed in a future release. Please use HTML comments instead. See %s" .Name .Position -}}
 {{- $noop := .Inner -}}
index d9c540cd9a30d0304c90294caf38a3c9e352b8f8..7f560f53ae6a215676d3026f01eac0f956b15025 100644 (file)
@@ -33,8 +33,9 @@ disableKinds = ['page','rss','section','sitemap','taxonomy','term']
 a{{< comment >}}b{{< /comment >}}c
 `
 
-       b := hugolib.Test(t, files)
+       b := hugolib.Test(t, files, hugolib.TestOptWarn())
        b.AssertFileContent("public/index.html", "<p>ac</p>")
+       b.AssertLogContains(`WARN  The "comment" shortcode was deprecated in v0.143.0 and will be removed in a future release. Please use HTML comments instead.`)
 }
 
 func TestDetailsShortcode(t *testing.T) {