summaryrefslogtreecommitdiffstats
path: root/hugolib/site.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2021-03-11 09:18:01 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2021-03-14 15:21:54 +0100
commitba1d0051b44fdd242b20899e195e37ab26501516 (patch)
tree646f815cf5eb027bae13e329696acf14d640d3f9 /hugolib/site.go
parent1b1dcf586e220c3a8ad5ecfa8e4c3dac97f0ab44 (diff)
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 'hugolib/site.go')
-rw-r--r--hugolib/site.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/hugolib/site.go b/hugolib/site.go
index d2a5e68ae..3c7c03bd1 100644
--- a/hugolib/site.go
+++ b/hugolib/site.go
@@ -913,7 +913,7 @@ type whatChanged struct {
// package, so it will behave correctly with Hugo's built-in server.
func (s *Site) RegisterMediaTypes() {
for _, mt := range s.mediaTypesConfig {
- for _, suffix := range mt.Suffixes {
+ for _, suffix := range mt.Suffixes() {
_ = mime.AddExtensionType(mt.Delimiter+suffix, mt.Type()+"; charset=utf-8")
}
}