Optimizing Hugo Image Display
Optimizing Hugo Image Display Hugo renders Markdown images directly by default. For large images, you can wrap them in a container through an image render hook, then use CSS to improve how they are displayed. This article uses the PaperMod theme as an example and implements hover zoom with pure CSS, without JavaScript or any third-party library. That way, a failed CDN request cannot break the feature. Problems with the previous approach If you only use :active in CSS, an image is enlarged only while the mouse button is held down, and it is hard to trigger on mobile. It also only scales the current image; it does not show a higher-resolution original. ...