From f42a4b6af511e105d172e643f147fc8d0bc02357 Mon Sep 17 00:00:00 2001 From: Joe Mooring Date: Thu, 23 Jan 2025 10:43:31 -0800 Subject: [PATCH] tpl/tplimpl: Deprecate gist shortcode Closes #13211 --- .../embedded/templates/shortcodes/gist.html | 1 + tpl/tplimpl/shortcodes_integration_test.go | 23 +++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/tpl/tplimpl/embedded/templates/shortcodes/gist.html b/tpl/tplimpl/embedded/templates/shortcodes/gist.html index 5f754f6514b..316d2d54ece 100644 --- a/tpl/tplimpl/embedded/templates/shortcodes/gist.html +++ b/tpl/tplimpl/embedded/templates/shortcodes/gist.html @@ -1 +1,2 @@ +{{- warnf "The %q shortcode was deprecated in v0.143.0 and will be removed in a future release. See https://gohugo.io/shortcodes/gist for instructions to create a replacement." .Name -}} diff --git a/tpl/tplimpl/shortcodes_integration_test.go b/tpl/tplimpl/shortcodes_integration_test.go index 7f560f53ae6..f3a5f7c1276 100644 --- a/tpl/tplimpl/shortcodes_integration_test.go +++ b/tpl/tplimpl/shortcodes_integration_test.go @@ -30,6 +30,9 @@ disableKinds = ['page','rss','section','sitemap','taxonomy','term'] -- layouts/index.html -- {{ .Content }} -- content/_index.md -- +--- +title: home +--- a{{< comment >}}b{{< /comment >}}c ` @@ -87,6 +90,26 @@ E: An _emphasized_ word. ) } +func TestGistShortcode(t *testing.T) { + t.Parallel() + + files := ` +-- hugo.toml -- +disableKinds = ['page','rss','section','sitemap','taxonomy','term'] +-- layouts/index.html -- +{{ .Content }} +-- content/_index.md -- +--- +title: home +--- +{{< gist jmooring 23932424365401ffa5e9d9810102a477 >}} +` + + b := hugolib.Test(t, files, hugolib.TestOptWarn()) + b.AssertFileContent("public/index.html", ``) + b.AssertLogContains(`WARN The "gist" shortcode was deprecated in v0.143.0 and will be removed in a future release. See https://gohugo.io/shortcodes/gist for instructions to create a replacement.`) +} + func TestInstagramShortcode(t *testing.T) { t.Parallel()