mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-30 22:39:58 +02:00
@@ -7,7 +7,7 @@ import (
|
||||
// This is is just some helpers used to create some JSON used in the Hugo docs.
|
||||
func init() {
|
||||
docsProvider := func() docshelper.DocProvider {
|
||||
return docshelper.DocProvider{"media": map[string]interface{}{"types": DefaultTypes}}
|
||||
return docshelper.DocProvider{"media": map[string]any{"types": DefaultTypes}}
|
||||
}
|
||||
docshelper.AddDocProviderFunc(docsProvider)
|
||||
}
|
||||
|
@@ -450,7 +450,7 @@ Note that you can still get the Media Type's suffix from a template: {{ $mediaTy
|
||||
|
||||
// DecodeTypes takes a list of media type configurations and merges those,
|
||||
// in the order given, with the Hugo defaults as the last resort.
|
||||
func DecodeTypes(mms ...map[string]interface{}) (Types, error) {
|
||||
func DecodeTypes(mms ...map[string]any) (Types, error) {
|
||||
var m Types
|
||||
|
||||
// Maps type string to Type. Type string is the full application/svg+xml.
|
||||
|
@@ -231,15 +231,15 @@ func TestDecodeTypes(t *testing.T) {
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
maps []map[string]interface{}
|
||||
maps []map[string]any
|
||||
shouldError bool
|
||||
assert func(t *testing.T, name string, tt Types)
|
||||
}{
|
||||
{
|
||||
"Redefine JSON",
|
||||
[]map[string]interface{}{
|
||||
[]map[string]any{
|
||||
{
|
||||
"application/json": map[string]interface{}{
|
||||
"application/json": map[string]any{
|
||||
"suffixes": []string{"jasn"},
|
||||
},
|
||||
},
|
||||
@@ -255,9 +255,9 @@ func TestDecodeTypes(t *testing.T) {
|
||||
},
|
||||
{
|
||||
"MIME suffix in key, multiple file suffixes, custom delimiter",
|
||||
[]map[string]interface{}{
|
||||
[]map[string]any{
|
||||
{
|
||||
"application/hugo+hg": map[string]interface{}{
|
||||
"application/hugo+hg": map[string]any{
|
||||
"suffixes": []string{"hg1", "hG2"},
|
||||
"Delimiter": "_",
|
||||
},
|
||||
@@ -281,9 +281,9 @@ func TestDecodeTypes(t *testing.T) {
|
||||
},
|
||||
{
|
||||
"Add custom media type",
|
||||
[]map[string]interface{}{
|
||||
[]map[string]any{
|
||||
{
|
||||
"text/hugo+hgo": map[string]interface{}{
|
||||
"text/hugo+hgo": map[string]any{
|
||||
"Suffixes": []string{"hgo2"},
|
||||
},
|
||||
},
|
||||
|
Reference in New Issue
Block a user