tpl: Add a test case

I'm not able to reproduce this, but leaving it in.

Closes #13699
This commit is contained in:
Bjørn Erik Pedersen
2025-05-17 13:34:37 +02:00
parent 61317821e4
commit 5a81a3a4cf

View 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")
}