]> git.maquefel.me Git - brevno-suite/hugo/commitdiff
tpl: Add a test case
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sat, 17 May 2025 11:34:37 +0000 (13:34 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sun, 18 May 2025 10:48:24 +0000 (12:48 +0200)
I'm not able to reproduce this, but leaving it in.

Closes #13699

tpl/tplimpl/shortcodes_integration_test.go

index e65f82eab058cbac3a758ee02bb47ba6acb39c08..e884c9a8d6b9eb1bc988a4992bd613b09d5087de 100644 (file)
@@ -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")
+}