Skip to content

perf: lazy-load below-the-fold images and improve font loading - #171

Merged
magnus-madsen merged 1 commit into
masterfrom
perf-lazy-images-fonts
Aug 3, 2026
Merged

perf: lazy-load below-the-fold images and improve font loading#171
magnus-madsen merged 1 commit into
masterfrom
perf-lazy-images-fonts

Conversation

@magnus-madsen

Copy link
Copy Markdown
Member

Summary

Items 9 and 10 from the site audit:

Font loading (Layout.astro)

  • Add <link rel=preconnect> for fonts.googleapis.com and fonts.gstatic.com so the font connection is established early
  • Add &display=swap to the Google Fonts URL so text renders immediately in a fallback font instead of blocking on Open Sans

Lazy-loading images

  • loading=lazy on all below-the-fold images: all 11 images on the index page, 6 of 7 feature screenshots on the vscode page, and the department photo on the internships page
  • Deliberately kept eager: the fork-me ribbon (above the fold everywhere), install.png on get-started (main content / likely LCP element), and the first vscode feature screenshot (near the fold)

Testing

  • npm run build completes cleanly; all 9 pages generated
  • Verified built HTML: preconnect + display=swap links present; loading=lazy counts per page match expectations (index: 11, vscode: 6, internships: 1)

🤖 Generated with Claude Code

- Add preconnect hints for Google Fonts origins and display=swap to
  avoid render-blocking font loads and invisible text (FOIT)
- Add loading=lazy to all below-the-fold images on the index,
  vscode, and internships pages
- Keep near-fold images eager: the fork-me ribbon, install.png on
  get-started (likely LCP), and the first vscode feature screenshot

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@magnus-madsen
magnus-madsen merged commit 01b35a1 into master Aug 3, 2026
1 check passed
@magnus-madsen
magnus-madsen deleted the perf-lazy-images-fonts branch August 3, 2026 04:56
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