mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
Improve minifier MIME type resolution
This commit also removes the deprecated `Suffix` from MediaType. Now use `Suffixes` and put the MIME type suffix in the type, e.g. `application/svg+xml`. Fixes #5093
This commit is contained in:
@@ -97,7 +97,7 @@ top = "top"
|
||||
|
||||
[mediaTypes]
|
||||
[mediaTypes."text/m1"]
|
||||
suffix = "m1main"
|
||||
suffixes = ["m1main"]
|
||||
|
||||
[outputFormats.o1]
|
||||
mediaType = "text/m1"
|
||||
@@ -135,9 +135,9 @@ p3 = "p3 theme"
|
||||
|
||||
[mediaTypes]
|
||||
[mediaTypes."text/m1"]
|
||||
suffix = "m1theme"
|
||||
suffixes = ["m1theme"]
|
||||
[mediaTypes."text/m2"]
|
||||
suffix = "m2theme"
|
||||
suffixes = ["m2theme"]
|
||||
|
||||
[outputFormats.o1]
|
||||
mediaType = "text/m1"
|
||||
@@ -207,10 +207,14 @@ map[string]interface {}{
|
||||
b.AssertObject(`
|
||||
map[string]interface {}{
|
||||
"text/m1": map[string]interface {}{
|
||||
"suffix": "m1main",
|
||||
"suffixes": []interface {}{
|
||||
"m1main",
|
||||
},
|
||||
},
|
||||
"text/m2": map[string]interface {}{
|
||||
"suffix": "m2theme",
|
||||
"suffixes": []interface {}{
|
||||
"m2theme",
|
||||
},
|
||||
},
|
||||
}`, got["mediatypes"])
|
||||
|
||||
@@ -221,7 +225,6 @@ map[string]interface {}{
|
||||
"mediatype": Type{
|
||||
MainType: "text",
|
||||
SubType: "m1",
|
||||
OldSuffix: "m1main",
|
||||
Delimiter: ".",
|
||||
Suffixes: []string{
|
||||
"m1main",
|
||||
@@ -233,7 +236,6 @@ map[string]interface {}{
|
||||
"mediatype": Type{
|
||||
MainType: "text",
|
||||
SubType: "m2",
|
||||
OldSuffix: "m2theme",
|
||||
Delimiter: ".",
|
||||
Suffixes: []string{
|
||||
"m2theme",
|
||||
|
Reference in New Issue
Block a user