hugo/resource
Bjørn Erik Pedersen b874a1ba7a media: Allow multiple file suffixes per media type
Before this commit, `Suffix` on `MediaType` was used both to set a custom file suffix and as a 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"]

Hugo will still respect values set in "suffix" if no value for "suffixes" is provided, but this will be removed in a future release.

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.

Fixes #4920
2018-07-10 22:13:52 +02:00
..
bundler media: Allow multiple file suffixes per media type 2018-07-10 22:13:52 +02:00
create Add Hugo Piper with SCSS support and much more 2018-07-06 11:46:12 +02:00
integrity Add Hugo Piper with SCSS support and much more 2018-07-06 11:46:12 +02:00
minifiers media: Allow multiple file suffixes per media type 2018-07-10 22:13:52 +02:00
postcss Add Hugo Piper with SCSS support and much more 2018-07-06 11:46:12 +02:00
templates Add Hugo Piper with SCSS support and much more 2018-07-06 11:46:12 +02:00
testdata resource: Fix path duplication/flattening in processed images 2018-03-14 17:04:14 +01:00
tocss/scss Add Hugo Piper with SCSS support and much more 2018-07-06 11:46:12 +02:00
image.go Add Hugo Piper with SCSS support and much more 2018-07-06 11:46:12 +02:00
image_cache.go Add Hugo Piper with SCSS support and much more 2018-07-06 11:46:12 +02:00
image_test.go Add Hugo Piper with SCSS support and much more 2018-07-06 11:46:12 +02:00
resource.go media: Allow multiple file suffixes per media type 2018-07-10 22:13:52 +02:00
resource_cache.go Add Hugo Piper with SCSS support and much more 2018-07-06 11:46:12 +02:00
resource_metadata.go Add Hugo Piper with SCSS support and much more 2018-07-06 11:46:12 +02:00
resource_metadata_test.go Add Hugo Piper with SCSS support and much more 2018-07-06 11:46:12 +02:00
resource_test.go media: Allow multiple file suffixes per media type 2018-07-10 22:13:52 +02:00
smartcrop.go resource: Add smart cropping 2018-02-05 13:59:15 +01:00
testhelpers_test.go Add Hugo Piper with SCSS support and much more 2018-07-06 11:46:12 +02:00
transform.go Fix typos 2018-07-07 12:29:56 +02:00
transform_test.go Add Hugo Piper with SCSS support and much more 2018-07-06 11:46:12 +02:00