mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-27 22:09:53 +02:00
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
This commit is contained in:
@@ -265,7 +265,7 @@ func (f Format) SupportsTransparency() bool {
|
||||
// DefaultExtension returns the default file extension of this format, starting with a dot.
|
||||
// For example: .jpg for JPEG
|
||||
func (f Format) DefaultExtension() string {
|
||||
return f.MediaType().FullSuffix()
|
||||
return f.MediaType().FirstSuffix.FullSuffix
|
||||
}
|
||||
|
||||
// MediaType returns the media type of this image, e.g. image/jpeg for JPEG
|
||||
|
Reference in New Issue
Block a user