mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-26 05:30:54 +03:00
parent
423594e03a
commit
b80853de90
342 changed files with 2118 additions and 2102 deletions
|
@ -124,7 +124,7 @@ func decodeConfig(cfg config.Provider) (conf minifyConfig, err error) {
|
|||
|
||||
func init() {
|
||||
docsProvider := func() docshelper.DocProvider {
|
||||
return docshelper.DocProvider{"config": map[string]interface{}{"minify": parser.LowerCaseCamelJSONMarshaller{Value: defaultConfig}}}
|
||||
return docshelper.DocProvider{"config": map[string]any{"minify": parser.LowerCaseCamelJSONMarshaller{Value: defaultConfig}}}
|
||||
}
|
||||
docshelper.AddDocProviderFunc(docsProvider)
|
||||
}
|
||||
|
|
|
@ -25,10 +25,10 @@ func TestConfig(t *testing.T) {
|
|||
c := qt.New(t)
|
||||
v := config.New()
|
||||
|
||||
v.Set("minify", map[string]interface{}{
|
||||
v.Set("minify", map[string]any{
|
||||
"disablexml": true,
|
||||
"tdewolff": map[string]interface{}{
|
||||
"html": map[string]interface{}{
|
||||
"tdewolff": map[string]any{
|
||||
"html": map[string]any{
|
||||
"keepwhitespace": false,
|
||||
},
|
||||
},
|
||||
|
|
|
@ -77,10 +77,10 @@ func TestNew(t *testing.T) {
|
|||
func TestConfigureMinify(t *testing.T) {
|
||||
c := qt.New(t)
|
||||
v := config.New()
|
||||
v.Set("minify", map[string]interface{}{
|
||||
v.Set("minify", map[string]any{
|
||||
"disablexml": true,
|
||||
"tdewolff": map[string]interface{}{
|
||||
"html": map[string]interface{}{
|
||||
"tdewolff": map[string]any{
|
||||
"html": map[string]any{
|
||||
"keepwhitespace": true,
|
||||
},
|
||||
},
|
||||
|
@ -137,8 +137,8 @@ func TestJSONRoundTrip(t *testing.T) {
|
|||
}`} {
|
||||
|
||||
var b bytes.Buffer
|
||||
m1 := make(map[string]interface{})
|
||||
m2 := make(map[string]interface{})
|
||||
m1 := make(map[string]any)
|
||||
m2 := make(map[string]any)
|
||||
c.Assert(json.Unmarshal([]byte(test), &m1), qt.IsNil)
|
||||
c.Assert(m.Minify(media.JSONType, &b, strings.NewReader(test)), qt.IsNil)
|
||||
c.Assert(json.Unmarshal(b.Bytes(), &m2), qt.IsNil)
|
||||
|
@ -172,13 +172,13 @@ func TestBugs(t *testing.T) {
|
|||
func TestDecodeConfigDecimalIsNowPrecision(t *testing.T) {
|
||||
c := qt.New(t)
|
||||
v := config.New()
|
||||
v.Set("minify", map[string]interface{}{
|
||||
v.Set("minify", map[string]any{
|
||||
"disablexml": true,
|
||||
"tdewolff": map[string]interface{}{
|
||||
"css": map[string]interface{}{
|
||||
"tdewolff": map[string]any{
|
||||
"css": map[string]any{
|
||||
"decimal": 3,
|
||||
},
|
||||
"svg": map[string]interface{}{
|
||||
"svg": map[string]any{
|
||||
"decimal": 3,
|
||||
},
|
||||
},
|
||||
|
@ -195,9 +195,9 @@ func TestDecodeConfigDecimalIsNowPrecision(t *testing.T) {
|
|||
func TestDecodeConfigKeepWhitespace(t *testing.T) {
|
||||
c := qt.New(t)
|
||||
v := config.New()
|
||||
v.Set("minify", map[string]interface{}{
|
||||
"tdewolff": map[string]interface{}{
|
||||
"html": map[string]interface{}{
|
||||
v.Set("minify", map[string]any{
|
||||
"tdewolff": map[string]any{
|
||||
"html": map[string]any{
|
||||
"keepEndTags": false,
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue