Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tpl
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2021-03-11 11:18:01 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2021-03-14 17:21:54 +0300
commitba1d0051b44fdd242b20899e195e37ab26501516 (patch)
tree646f815cf5eb027bae13e329696acf14d640d3f9 /tpl
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 'tpl')
-rw-r--r--tpl/tplimpl/shortcodes.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/tpl/tplimpl/shortcodes.go b/tpl/tplimpl/shortcodes.go
index 789bc07d3..938fc74e2 100644
--- a/tpl/tplimpl/shortcodes.go
+++ b/tpl/tplimpl/shortcodes.go
@@ -56,7 +56,7 @@ func (s *shortcodeTemplates) fromVariants(variants tpl.TemplateVariants) (shortc
return s.fromVariantsSlice([]string{
variants.Language,
strings.ToLower(variants.OutputFormat.Name),
- variants.OutputFormat.MediaType.Suffix(),
+ variants.OutputFormat.MediaType.FirstSuffix.Suffix,
})
}