perf: lazy-load below-the-fold images and improve font loading - #171
Merged
Conversation
- 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Items 9 and 10 from the site audit:
Font loading (
Layout.astro)<link rel=preconnect>forfonts.googleapis.comandfonts.gstatic.comso the font connection is established early&display=swapto the Google Fonts URL so text renders immediately in a fallback font instead of blocking on Open SansLazy-loading images
loading=lazyon 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 pageinstall.pngon get-started (main content / likely LCP element), and the first vscode feature screenshot (near the fold)Testing
npm run buildcompletes cleanly; all 9 pages generateddisplay=swaplinks present;loading=lazycounts per page match expectations (index: 11, vscode: 6, internships: 1)🤖 Generated with Claude Code