Skip to content

Fix blog image layout shift - #2237

Merged
Andarist merged 1 commit into
mainfrom
fix-blog-cls
Aug 11, 2026
Merged

Fix blog image layout shift#2237
Andarist merged 1 commit into
mainfrom
fix-blog-cls

Conversation

@bluwy

@bluwy bluwy commented Aug 11, 2026

Copy link
Copy Markdown
Member

I noticed the images causes layout shift because the width and height attributes aren't set. This sets them.

Also, fixed the alt text for VPImage in object form.

@netlify

netlify Bot commented Aug 11, 2026

Copy link
Copy Markdown

Deploy Preview for changesets ready!

Name Link
🔨 Latest commit ab24e86
🔍 Latest deploy log https://app.netlify.com/projects/changesets/deploys/6a7b21a916afd900080435ca
😎 Deploy Preview https://deploy-preview-2237--changesets.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@changeset-bot

changeset-bot Bot commented Aug 11, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: ab24e86

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

alt="cli flow example"
:image="cliExampleImage"
/>
![cli flow example](../assets/cli-example.webp)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VitePress can auto-calculate the width and height using this markdown form, so converted it this way here.

I need to investigate later is there's a better way to support light-dark images without using VPImage so we can get this automatic size calculation as well.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't add the lazy property iirc when I added it, even with the vitepress setting

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But that should be fine, it's a small-ish image

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting markdown.image.lazyLoad seems to add for the markdown images, we can add it though

@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.53%. Comparing base (a437c0d) to head (ab24e86).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2237   +/-   ##
=======================================
  Coverage   84.53%   84.53%           
=======================================
  Files          80       80           
  Lines        3168     3168           
  Branches      892      892           
=======================================
  Hits         2678     2678           
  Misses        433      433           
  Partials       57       57           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Andarist
Andarist added this pull request to the merge queue Aug 11, 2026
Merged via the queue into main with commit 2f08662 Aug 11, 2026
18 checks passed
@Andarist
Andarist deleted the fix-blog-cls branch August 11, 2026 13:34
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.

3 participants