hugo-theme-stack/layouts/_default/_markup
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
..
render-codeblock.html fix(codeblock): pass through the options of chroma (#715) 2022-12-03 13:14:37 +01:00
render-image.html feat: add file types whitelist for image processing (#885) 2023-10-11 22:51:42 +02:00
render-link.html feat(article): add render-link hook 2020-08-24 12:07:58 +02:00