Allow specifying thumbnail image resolution for websites #8096
yuxi-liu-wired
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
For generating static websites, the thumbnail image can be unnecessarily large. It would be cumbersome to manually create a thumbnail image for the preview. It would be good if the user can specify in the YAML the desired width/height/aspect ratio, and let the generator compile it.
Rescaling images can be done by
convert
,imagemagick
orPython Pillow
, or some other lightweight tool. Apparentlywebp
is recommended for now? See https://web.dev/articles/serve-images-webp.According to Frequently Asked Questions | WebP | Google for Developers, HTML allows
<picture>
to specify alternative formats, which means ifwebp
is not supported, another format can be fallbacked..The following is my idea of what it could look like:
Also, it might be useful to try
avif
too. There is a node package for it. lovell/avif-cli: Command line utility to convert images to AVIF, requires Node.js 14.15.0+.Beta Was this translation helpful? Give feedback.
All reactions