]> git.maquefel.me Git - brevno-suite/hugo/commitdiff
Fix deprecation errors
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Mon, 5 Aug 2024 17:14:07 +0000 (19:14 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Mon, 5 Aug 2024 17:23:53 +0000 (19:23 +0200)
hugolib/language_test.go
testscripts/commands/hugo.txt
testscripts/commands/server.txt
tpl/collections/collections_integration_test.go
tpl/collections/init.go

index 582d3985fdb7c3beed3b1370f95fa931611ddf1a..f7dd5b79d007667f9a485818a881232a3708613a 100644 (file)
@@ -104,8 +104,7 @@ FormatCurrency: {{ 512.5032 | lang.FormatCurrency 2 "USD" }}
 FormatAccounting: {{ 512.5032 | lang.FormatAccounting 2 "NOK" }}
 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
 FormatNumberCustom: 12,345.68
         
-NumFmt: -98,765.43
 `,
        )
 
@@ -131,8 +129,6 @@ FormatCurrency: 512,50 USD
 FormatAccounting: 512,50 kr
 FormatNumberCustom: 12,345.68
 
-# We renamed this to FormatNumberCustom in 0.87.0.
-NumFmt: -98,765.43
 `)
 }
 
index 60f7ffe71a2ab0cae94a4c665b292e2546fe3c6d..bf0f5cf0d39dcf2d4e4ce0e703af6fed8234fd57 100644 (file)
@@ -11,7 +11,7 @@ grep 'IsServer: false;IsProduction: true'  public/index.html
 baseURL = "http://example.org/"
 disableKinds = ["RSS", "sitemap", "robotsTXT", "404", "taxonomy", "term"]
 -- layouts/index.html --
-Home|IsServer: {{ .Site.IsServer }};IsProduction: {{ hugo.IsProduction }}|
+Home|IsServer: {{ hugo.IsServer }};IsProduction: {{ hugo.IsProduction }}|
 -- layouts/_default/single.html --
 Title: {{ .Title }}
 -- content/p1.md --
index a28e4d69832b903e56fa3108cc93bb295e29fde4..7f6afd8fd7bfaebaf3c1864767f2c79b0d336cb1 100644 (file)
@@ -25,7 +25,7 @@ myenv = "theproduction"
 myenv = "thedevelopment"
 -- layouts/index.html --
 <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>
 -- layouts/404.html --
 custom 404
index 3bcd4effbd0beb94507074c42f7fb6a59bd0e9a8..e39493b529bf5c21f569d714334fa9b3125d37af 100644 (file)
@@ -202,35 +202,6 @@ foo: bc
        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) {
        t.Parallel()
 
index 8801422ac5dae1292286cdd3bee1198dd1893ee6..20711f9e46c16876a42e0fdd02404e494c667188 100644 (file)
@@ -69,9 +69,7 @@ func init() {
 
                ns.AddMethodMapping(ctx.EchoParam,
                        []string{"echoParam"},
-                       [][2]string{
-                               {`{{ echoParam .Params "langCode" }}`, `en`},
-                       },
+                       [][2]string{},
                )
 
                ns.AddMethodMapping(ctx.First,