diff options
author | Bjørn Erik Pedersen <[email protected]> | 2023-12-18 17:41:15 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2023-12-18 19:51:26 +0100 |
commit | 8adba648cc130a97d2c814c65aa8396044c251fd (patch) | |
tree | 95415853e28ee83e0342cc55944f3bc16d746f4f /media/config.go | |
parent | 6f13430d4a3b0d8b196f13958fbfb6478be1f3aa (diff) | |
download | hugo-8adba648cc130a97d2c814c65aa8396044c251fd.tar.gz hugo-8adba648cc130a97d2c814c65aa8396044c251fd.zip |
all: Remove unused code
Using x/tools/cmd/deadcode
Diffstat (limited to 'media/config.go')
-rw-r--r-- | media/config.go | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/media/config.go b/media/config.go index 72583f267..b356132be 100644 --- a/media/config.go +++ b/media/config.go @@ -31,7 +31,6 @@ import ( var DefaultTypes Types func init() { - ns, err := DecodeTypes(nil) if err != nil { panic(err) @@ -61,7 +60,6 @@ type MediaTypeConfig struct { // DecodeTypes decodes the given map of media types. func DecodeTypes(in map[string]any) (*config.ConfigNamespace[map[string]MediaTypeConfig, Types], error) { - buildConfig := func(v any) (Types, any, error) { m, err := maps.ToStringMapE(v) if err != nil { @@ -106,34 +104,4 @@ func DecodeTypes(in map[string]any) (*config.ConfigNamespace[map[string]MediaTyp return nil, fmt.Errorf("failed to decode media types: %w", err) } return ns, nil - -} - -func suffixIsRemoved() error { - return errors.New(`MediaType.Suffix is removed. Before Hugo 0.44 this was used both to set a custom file suffix and as way -to augment the mediatype definition (what you see after the "+", e.g. "image/svg+xml"). - -This had its limitations. For one, it was only possible with one file extension per MIME type. - -Now you can specify multiple file suffixes using "suffixes", but you need to specify the full MIME type -identifier: - -[mediaTypes] -[mediaTypes."image/svg+xml"] -suffixes = ["svg", "abc" ] - -In most cases, it will be enough to just change: - -[mediaTypes] -[mediaTypes."my/custom-mediatype"] -suffix = "txt" - -To: - -[mediaTypes] -[mediaTypes."my/custom-mediatype"] -suffixes = ["txt"] - -Note that you can still get the Media Type's suffix from a template: {{ $mediaType.Suffix }}. But this will now map to the MIME type filename. -`) } |