diff options
author | Bjørn Erik Pedersen <[email protected]> | 2021-03-11 09:18:01 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2021-03-14 15:21:54 +0100 |
commit | ba1d0051b44fdd242b20899e195e37ab26501516 (patch) | |
tree | 646f815cf5eb027bae13e329696acf14d640d3f9 /resources/postpub | |
parent | 1b1dcf586e220c3a8ad5ecfa8e4c3dac97f0ab44 (diff) | |
download | hugo-ba1d0051b44fdd242b20899e195e37ab26501516.tar.gz hugo-ba1d0051b44fdd242b20899e195e37ab26501516.zip |
media: Make Type comparable
So we can use it and output.Format as map key etc.
This commit also fixes the media.Type implementation so it does not need to mutate itself to handle different suffixes for the same MIME type, e.g. jpg vs. jpeg.
This means that there are no Suffix or FullSuffix on media.Type anymore.
Fixes #8317
Fixes #8324
Diffstat (limited to 'resources/postpub')
-rw-r--r-- | resources/postpub/fields_test.go | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/resources/postpub/fields_test.go b/resources/postpub/fields_test.go index 10a68ac5a..19c3720f7 100644 --- a/resources/postpub/fields_test.go +++ b/resources/postpub/fields_test.go @@ -31,15 +31,14 @@ func TestCreatePlaceholders(t *testing.T) { }) c.Assert(m, qt.DeepEquals, map[string]interface{}{ - "FullSuffix": "pre_foo.FullSuffix_post", "IsZero": "pre_foo.IsZero_post", - "Type": "pre_foo.Type_post", - "MainType": "pre_foo.MainType_post", - "Delimiter": "pre_foo.Delimiter_post", "MarshalJSON": "pre_foo.MarshalJSON_post", + "Suffixes": "pre_foo.Suffixes_post", + "Delimiter": "pre_foo.Delimiter_post", + "FirstSuffix": "pre_foo.FirstSuffix_post", "String": "pre_foo.String_post", - "Suffix": "pre_foo.Suffix_post", + "Type": "pre_foo.Type_post", + "MainType": "pre_foo.MainType_post", "SubType": "pre_foo.SubType_post", - "Suffixes": "pre_foo.Suffixes_post", }) } |