mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-30 20:00:48 +00:00
b874a1ba7a
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 |
||
---|---|---|
.. | ||
bundler | ||
create | ||
integrity | ||
minifiers | ||
postcss | ||
templates | ||
testdata | ||
tocss/scss | ||
image.go | ||
image_cache.go | ||
image_test.go | ||
resource.go | ||
resource_cache.go | ||
resource_metadata.go | ||
resource_metadata_test.go | ||
resource_test.go | ||
smartcrop.go | ||
testhelpers_test.go | ||
transform.go | ||
transform_test.go |