Skip to content

Update image lazy loading behavior in post-card.hbs #993

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

0xsuid
Copy link

@0xsuid 0xsuid commented Apr 25, 2025

Description

  • Disabled lazy loading for the first image to improve perceived page load speed and Largest Contentful Paint (LCP) metrics.
  • Updated the loading attribute to be dynamic:
    loading="{{#if @index}}lazy{{else}}eager{{/if}}"
  • The first image (@index = 0) now uses eager loading.
  • All subsequent images continue to use lazy loading.

Why:

Improving the loading strategy for critical content enhances user experience and boosts SEO performance by optimizing core web vitals

Disable lazy loading for the first image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant