diff --git a/hugolib/site_output_test.go b/hugolib/site_output_test.go index 9bcb13ea4..a68555574 100644 --- a/hugolib/site_output_test.go +++ b/hugolib/site_output_test.go @@ -330,8 +330,7 @@ func TestGetOutputFormatRel(t *testing.T) { b := newTestSitesBuilder(t). WithSimpleConfigFileAndSettings(map[string]any{ "outputFormats": map[string]any{ - "humansTXT": map[string]any{ - "name": "HUMANS", + "HUMANS": map[string]any{ "mediaType": "text/plain", "baseName": "humans", "isPlainText": true, diff --git a/output/config.go b/output/config.go index a7ebf5107..09d29f184 100644 --- a/output/config.go +++ b/output/config.go @@ -65,10 +65,10 @@ func DecodeConfig(mediaTypes media.Types, in any) (*config.ConfigNamespace[map[s } newOutFormat := defaultOutputFormat - newOutFormat.Name = k if err := decode(mediaTypes, v, &newOutFormat); err != nil { return f, nil, err } + newOutFormat.Name = k f = append(f, newOutFormat) diff --git a/output/outputFormat.go b/output/outputFormat.go index 54e7fe98d..981d895b6 100644 --- a/output/outputFormat.go +++ b/output/outputFormat.go @@ -29,7 +29,7 @@ type Format struct { // The Name is used as an identifier. Internal output formats (i.e. html and rss) // can be overridden by providing a new definition for those types. // { "identifiers": ["html", "rss"] } - Name string `json:"name"` + Name string `json:"-"` MediaType media.Type `json:"-"`