hugo-PaperMod icon indicating copy to clipboard operation
hugo-PaperMod copied to clipboard

Content with Cover Images generate Cumulative Layout Shift

Open jaxn020 opened this issue 3 years ago • 2 comments
trafficstars

Dear Adithya, kindly check on this. Posts without any Cover Image ( Ex: https://adityatelange.github.io/hugo-PaperMod/posts/papermod/papermod-installation/) show ZERO CLS score (which is perfect!), But as soon as an Image is added (as cover image), either TOC creates a shift, or when TOC is false, post-content creates a shift or sometimes both. The CLS score is >0.2 which hurts site metrics. Please throw some light. By the way, thanks for this Wonderful Theme!

jaxn020 avatar Jun 29 '22 07:06 jaxn020

Can you help me why fix this? Pls investigate why this is happening.

adityatelange avatar Jul 08 '22 15:07 adityatelange

Can you help me why fix this? Pls investigate why this is happening.

@adityatelange ,it's happening because we're not defining image size on attribute. it might helpful https://gtmetrix.com/cumulative-layout-shift.html

sunuazizrahayu avatar Aug 03 '22 17:08 sunuazizrahayu

Can you help me why fix this? Pls investigate why this is happening.

@adityatelange ,it's happening because we're not defining image size on attribute. it might helpful https://gtmetrix.com/cumulative-layout-shift.html

We are when using page bundles. https://github.com/adityatelange/hugo-PaperMod/blob/045c08496d61b1b3f9c79e69e7d3d243a526d8f3/layouts/partials/cover.html#L27

there's no wat to calc it if you're statically linking it instead of using page bundles.

adityatelange avatar Dec 31 '23 16:12 adityatelange