Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b01cc14

Browse files
committed
Revert "common/hugo: Deprecate extended and extended_withdeploy editions"
This reverts commit a17bdbc. Close #14771
1 parent 8ee19ff commit b01cc14

4 files changed

Lines changed: 1 addition & 52 deletions

File tree

commands/commandeer.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ import (
3939

4040
"github.com/gohugoio/hugo/common/hstrings"
4141
"github.com/gohugoio/hugo/common/htime"
42-
"github.com/gohugoio/hugo/common/hugo"
4342
"github.com/gohugoio/hugo/common/loggers"
4443
"github.com/gohugoio/hugo/common/paths"
4544
"github.com/gohugoio/hugo/common/types"
@@ -473,7 +472,6 @@ func (r *rootCommand) PreRun(cd, runner *simplecobra.Commandeer) error {
473472
}
474473
// Set up the global logger early to allow info deprecations during config load.
475474
loggers.SetGlobalLogger(r.logger)
476-
hugo.WarnDeprecatedEdition()
477475

478476
r.changesFromBuild = make(chan []identity.Identity, 10)
479477

common/hugo/hugo.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -304,18 +304,6 @@ func IsDartSassGeV2() bool {
304304
return !strings.Contains(DartSassBinaryName, "embedded")
305305
}
306306

307-
// WarnDeprecatedEdition emits a deprecation warning if the running binary is
308-
// the extended or extended_withdeploy edition.
309-
func WarnDeprecatedEdition() {
310-
if IsExtended {
311-
if IsWithdeploy {
312-
Deprecate("the extended_withdeploy edition of the Hugo executable", "Use the withdeploy edition instead.", "v0.161.0")
313-
} else {
314-
Deprecate("the extended edition of the Hugo executable", "Use the standard edition instead.", "v0.161.0")
315-
}
316-
}
317-
}
318-
319307
// Deprecate informs about a deprecation starting at the given version.
320308
//
321309
// A deprecation typically needs a simple change in the template, but doing so will make the template incompatible with older versions.

common/hugo/hugo_test.go

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,11 @@
1414
package hugo
1515

1616
import (
17-
"bytes"
1817
"context"
1918
"testing"
2019

2120
"github.com/bep/logg"
2221
qt "github.com/frankban/quicktest"
23-
"github.com/gohugoio/hugo/common/loggers"
2422
)
2523

2624
func TestDeprecationLogLevelFromVersion(t *testing.T) {
@@ -61,38 +59,3 @@ func TestGetBuildInfo(t *testing.T) {
6159
c.Assert(bi.GoVersion, qt.Not(qt.Equals), "")
6260
}
6361
}
64-
65-
func TestWarnDeprecatedEdition(t *testing.T) {
66-
c := qt.New(t)
67-
68-
origExtended, origWithdeploy := IsExtended, IsWithdeploy
69-
t.Cleanup(func() {
70-
IsExtended = origExtended
71-
IsWithdeploy = origWithdeploy
72-
loggers.SetGlobalLogger(nil)
73-
})
74-
75-
var buf bytes.Buffer
76-
loggers.SetGlobalLogger(loggers.New(loggers.Options{Level: logg.LevelInfo, StdErr: &buf}))
77-
78-
IsExtended = true
79-
IsWithdeploy = false
80-
WarnDeprecatedEdition()
81-
c.Assert(buf.String(), qt.Contains, "the extended edition of the Hugo executable")
82-
c.Assert(buf.String(), qt.Contains, "Use the standard edition instead")
83-
84-
buf.Reset()
85-
86-
IsExtended = true
87-
IsWithdeploy = true
88-
WarnDeprecatedEdition()
89-
c.Assert(buf.String(), qt.Contains, "the extended_withdeploy edition of the Hugo executable")
90-
c.Assert(buf.String(), qt.Contains, "Use the withdeploy edition instead")
91-
92-
buf.Reset()
93-
94-
IsExtended = false
95-
IsWithdeploy = false
96-
WarnDeprecatedEdition()
97-
c.Assert(buf.String(), qt.Equals, "")
98-
}

testscripts/commands/hugo__minify_issue13988.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
hugo --minify --logLevel=info
22

3-
! stderr 'deprecated.*minifyOutput'
3+
! stderr 'deprecated'
44
grep '<p>one</p><p>two</p>' public/index.html
55

66
-- hugo.toml --

0 commit comments

Comments
 (0)