From 5a81a3a4cf8fc0a75a5b7d1f1552664542592c48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Sat, 17 May 2025 13:34:37 +0200 Subject: [PATCH] tpl: Add a test case I'm not able to reproduce this, but leaving it in. Closes #13699 --- tpl/tplimpl/shortcodes_integration_test.go | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tpl/tplimpl/shortcodes_integration_test.go b/tpl/tplimpl/shortcodes_integration_test.go index e65f82eab..e884c9a8d 100644 --- a/tpl/tplimpl/shortcodes_integration_test.go +++ b/tpl/tplimpl/shortcodes_integration_test.go @@ -729,3 +729,31 @@ SHORTCODE b.Assert(err, qt.IsNotNil) b.Assert(err.Error(), qt.Contains, `no compatible template found for shortcode "mymarkdown" in [/_shortcodes/mymarkdown.md]; note that to use plain text template shortcodes in HTML you need to use the shortcode {{% delimiter`) } + +func TestShortcodeOnlyLanguageInBaseIssue13699(t *testing.T) { + t.Parallel() + + files := ` +-- hugo.toml -- +baseURL = 'https://example.org/' +[languages] +[languages.en] +weight = 1 +disableLanguages = ['de'] +[languages.de] +weight = 2 +-- layouts/_shortcodes/de.html -- +de.html +-- layouts/all.html -- +{{ .Content }} +-- content/_index.md -- +--- +title: home +--- +{{< de >}} + +` + b := hugolib.Test(t, files) + + b.AssertFileContent("public/index.html", "de.html") +}