Fix deprecation errors

This commit is contained in:
Bjørn Erik Pedersen 2024-08-05 19:14:07 +02:00
parent 2fcc53780f
commit 69455fa422
No known key found for this signature in database
5 changed files with 4 additions and 39 deletions

View file

@ -104,8 +104,7 @@ FormatCurrency: {{ 512.5032 | lang.FormatCurrency 2 "USD" }}
FormatAccounting: {{ 512.5032 | lang.FormatAccounting 2 "NOK" }} FormatAccounting: {{ 512.5032 | lang.FormatAccounting 2 "NOK" }}
FormatNumberCustom: {{ lang.FormatNumberCustom 2 12345.6789 }} FormatNumberCustom: {{ lang.FormatNumberCustom 2 12345.6789 }}
# We renamed this to FormatNumberCustom in 0.87.0.
NumFmt: {{ -98765.4321 | lang.NumFmt 2 }}
`) `)
@ -120,7 +119,6 @@ FormatCurrency: $512.50
FormatAccounting: NOK512.50 FormatAccounting: NOK512.50
FormatNumberCustom: 12,345.68 FormatNumberCustom: 12,345.68
NumFmt: -98,765.43
`, `,
) )
@ -131,8 +129,6 @@ FormatCurrency: 512,50 USD
FormatAccounting: 512,50 kr FormatAccounting: 512,50 kr
FormatNumberCustom: 12,345.68 FormatNumberCustom: 12,345.68
# We renamed this to FormatNumberCustom in 0.87.0.
NumFmt: -98,765.43
`) `)
} }

View file

@ -11,7 +11,7 @@ grep 'IsServer: false;IsProduction: true' public/index.html
baseURL = "http://example.org/" baseURL = "http://example.org/"
disableKinds = ["RSS", "sitemap", "robotsTXT", "404", "taxonomy", "term"] disableKinds = ["RSS", "sitemap", "robotsTXT", "404", "taxonomy", "term"]
-- layouts/index.html -- -- layouts/index.html --
Home|IsServer: {{ .Site.IsServer }};IsProduction: {{ hugo.IsProduction }}| Home|IsServer: {{ hugo.IsServer }};IsProduction: {{ hugo.IsProduction }}|
-- layouts/_default/single.html -- -- layouts/_default/single.html --
Title: {{ .Title }} Title: {{ .Title }}
-- content/p1.md -- -- content/p1.md --

View file

@ -25,7 +25,7 @@ myenv = "theproduction"
myenv = "thedevelopment" myenv = "thedevelopment"
-- layouts/index.html -- -- layouts/index.html --
<body> <body>
Title: {{ .Title }}|BaseURL: {{ site.BaseURL }}|ServerPort: {{ site.ServerPort }}|myenv: {{ .Site.Params.myenv }}|Env: {{ hugo.Environment }}|IsServer: {{ site.IsServer }}| Title: {{ .Title }}|BaseURL: {{ site.BaseURL }}|ServerPort: {{ site.ServerPort }}|myenv: {{ .Site.Params.myenv }}|Env: {{ hugo.Environment }}|IsServer: {{ hugo.IsServer }}|
</body> </body>
-- layouts/404.html -- -- layouts/404.html --
custom 404 custom 404

View file

@ -202,35 +202,6 @@ foo: bc
b.AssertFileContent("public/index.html", "<ul><li>P1</li><li>P2</li></ul>") b.AssertFileContent("public/index.html", "<ul><li>P1</li><li>P2</li></ul>")
} }
// Issue #11498
func TestEchoParams(t *testing.T) {
t.Parallel()
files := `
-- hugo.toml --
[params.footer]
string = 'foo'
int = 42
float = 3.1415
boolt = true
boolf = false
-- layouts/index.html --
{{ echoParam .Site.Params.footer "string" }}
{{ echoParam .Site.Params.footer "int" }}
{{ echoParam .Site.Params.footer "float" }}
{{ echoParam .Site.Params.footer "boolt" }}
{{ echoParam .Site.Params.footer "boolf" }}
`
b := hugolib.Test(t, files)
b.AssertFileContent("public/index.html",
"foo",
"42",
"3.1415",
"true",
"false",
)
}
func TestTermEntriesCollectionsIssue12254(t *testing.T) { func TestTermEntriesCollectionsIssue12254(t *testing.T) {
t.Parallel() t.Parallel()

View file

@ -69,9 +69,7 @@ func init() {
ns.AddMethodMapping(ctx.EchoParam, ns.AddMethodMapping(ctx.EchoParam,
[]string{"echoParam"}, []string{"echoParam"},
[][2]string{ [][2]string{},
{`{{ echoParam .Params "langCode" }}`, `en`},
},
) )
ns.AddMethodMapping(ctx.First, ns.AddMethodMapping(ctx.First,