跳到正文
Skillpedia
社交媒体75k · #2959

og-image-size

它能做什么

这个技能检查页面在社交网络上分享时使用的 Open Graph 图片,如果它不符合常见要求,就会调整大小。它面向在社交平台上分享网站内容的人。

适用场景

  • ✓你请智能体检查或制作网页的社交分享图片的时候。
  • ✓分享链接时预览图片显示为空白、被裁切或模糊的时候。
  • ✓你在准备新页面,并希望它的分享图片适合社交平台的时候。

技能链接

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/og-image-size/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/og-image-size/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我分享链接时,预览图看起来被裁切或模糊了。请帮我检查并修复分享图片的尺寸吗?”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会找到 og:image 标签,获取图片,并检查其宽度、高度、宽高比和文件大小。然后它会建议或制作 1200×630 像素的版本,添加尺寸标签,并使用绝对的 HTTPS 地址。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

OG Image Size

An incorrectly sized og:image is displayed poorly or not at all on social platforms—Facebook, Twitter/X, LinkedIn each crop or skip images that don't meet their requirements, resulting in blank or distorted link previews.

Quick Reference

  • og:image should be 1200×630 pixels (1.91:1 aspect ratio)
  • Minimum size is 600×315 pixels; smaller images may not display
  • File size should stay under 5 MB; under 1 MB is preferred
  • Use JPEG or PNG; WebP has limited support on older platforms

Check

Find the og:image meta tag in <head> and fetch the image URL. Check the image dimensions and file size. Flag if width < 1200px, height < 630px, aspect ratio differs significantly from 1.91:1, or file size exceeds 5 MB.

Fix

Generate or resize the og:image to exactly 1200×630 pixels. Export as JPEG at 80–85% quality to balance visual quality and file size. Reference the absolute HTTPS URL in the og:image meta tag. Add og:image:width and og:image:height tags to help platforms render the image without downloading it first.

Explain

Social platforms use og:image to construct the visual card shown when a URL is shared. An image too small may be skipped or shown as a thumbnail. An image with the wrong aspect ratio gets cropped, often cutting off important content. The recommended 1200×630 size ensures optimal display across Facebook, LinkedIn, Slack, and iMessage.

Code Review

Check the og:image meta tag value. Fetch the image and verify: (1) dimensions are at least 1200×630 px, (2) aspect ratio is approximately 1.91:1, (3) file size is under 5 MB, (4) URL is absolute HTTPS, (5) og:image:width and og:image:height tags match actual dimensions. Flag relative URLs or images smaller than 600×315 px.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/seo/og-image-size

常见问题

分享图片的尺寸应该是多少?

这个技能推荐 1200×630 像素,即约 1.91 比 1 的宽高比。

哪种文件格式最好?

这个技能说 JPEG 或 PNG 最好,因为 WebP 在一些较旧的平台上支持有限。

为什么要添加宽度和高度标签?

它们可以帮助平台在不先下载图片的情况下显示图片。

详情

作者的原始描述

Use when auditing Open Graph tags or generating og:image assets. Applies to any page that may be shared on social networks or messaging platforms.

repo: thedaviddias/Front-End-Checklist

热度

GitHub 星标
75k
排名
#2959
许可证
MIT
更新时间
2026/10/31

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能