hugo-theme-stack/layouts/_default
Jimmy Cai 8dc2880a9c
feat: add file types whitelist for image processing (#885)
Add `allowedTypes` and `resizableTypes` to `imageProcessing` configuration

Prior to this commit, SVG images were not processed by `render-image.html` because SVG does not have a physical dimension like JPEG. This logic was done using a conditional.

I have now realised that Hugo can be very slow when resizing `gif` images. So I created this whitelist mechanism:

- `allowedTypes`: image types with width and height attributes
- `resizableTypes`: image types that can be resized

Here's a list of media types: bmp, gif, jpeg, png, svg+xml, tiff, webp

https://gohugo.io/templates/output-formats/#media-types
2023-10-11 22:51:42 +02:00
..
_markup feat: add file types whitelist for image processing (#885) 2023-10-11 22:51:42 +02:00
archives.html refactor: drop support for hidden field in front matter 2022-06-12 11:42:35 +00:00
baseof.html refactor(grid): avoid sidebar layout shift when main content loads slowly (#677) 2022-10-21 13:06:06 +02:00
list.html refactor(widget): taxonomy widget (#763) 2023-08-27 18:26:53 +02:00
rss.xml refactor: drop support for hidden field in front matter 2022-06-12 11:42:35 +00:00
single.html refactor: rename "Related contents" to "Related content" (#567) 2022-06-05 17:20:08 +02:00