Google has started penalising my blog due to Cumulative Layout Shift being longer than they mandate. Apparently, this happens because the hero images lack explicit height and width. Is there a workaround? I am using the stock Casper theme.
To fix this issue, you can customize the Casper theme to suite the image you’re using as a background. You would need to add the width and height attributes (matching your image) to the image tag in the index.hbs file. Rezip your theme and upload it. Then, you should avoid any cumulative layout shift on that element.
Alternatively, depending on your design preferences, you can also just delete the background image. Casper will then fallback to your brand color as the background. But this might be throwing the baby out with the bath water…
Thank you! Is there any way to get this achieved dynamically/automatically in Ghost? Also, are there themes (other than Casper) that achieve this, perhaps?