mirror of
https://github.com/alanorth/hugo-theme-bootstrap4-blog.git
synced 2024-11-18 18:27:03 +01:00
Alan Orth
147ee8cf76
This overrides Hugo's default figure shortcode to enable img srcset support, which allows the client to decide which size of image they want to download based on a CSS media query. During build time Hugo creates several versions of each image to match several breakpoints. Unfortunately this only works if the images are in the post's page bundle, falling back to retrieving images from the static directory if they aren't found in the bundle. This shortcode was originally from Charl P. Botha, but I modified it to automatically rotate images that have orientation EXIF data. See: https://gohugo.io/content-management/page-bundles/ See: http://www.johann-oberdorfer.eu/blog/2020/01/05/20-01-05_leverage_page_bundles_in_hugo/ See: https://cpbotha.net/2020/05/02/drop-in-replacement-for-hugo-figure-shortcode-with-responsive-img-srcset/ |
||
---|---|---|
.. | ||
figure.html |