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。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 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.
热度
- GitHub 星标
- 75k
- 排名
- #2959
- 许可证
- MIT
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
frontendchecklist
75k使用命令行工具,依据 380 多条关于无障碍、速度、SEO 和安全的规则,检查前端代码和线上页面。
frontend-checklist-global
75k依据全部 386 条 Front-End Checklist 规则审查前端项目,并为发现的每个问题给出具体修复方法。
404-page
75k检查你的页面缺失提示是否提供有用的链接,并返回真正的 404 状态,帮助迷路的访客找到方向。
about-page
75k审查你的网站是否有清晰的关于页面,说明由谁运营,以建立访客和搜索引擎的信任。