twitter-cards
它能做什么
这项技能添加用于控制网页在 X 上被分享时外观的标签。适用于在社交媒体上分享链接的网站所有者和营销人员。
适用场景
- ✓当在 X 上分享的页面只显示一个普通链接的时候。
- ✓当新网站需要社交分享标签的时候。
- ✓当分享的文章应当显示大图预览的时候。
技能链接
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/twitter-cards/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我在 X 上分享博客文章时只显示普通链接。请帮我添加正确的标签,使其显示图片和描述。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会在页面头部添加卡片类型、标题、描述和图片的 meta 标签。当缺少 Twitter 专用标签时,X 也会回退使用 Open Graph 标签。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Add Twitter Card meta tags
Pages shared on X without Twitter Cards show only a bare link; Cards add an image and description that significantly increase click-through rates from social traffic.
Quick Reference
- Add
<meta name="twitter:card" content="summary_large_image">to enable rich previews when shared on X (Twitter) - Minimum required tags:
twitter:card,twitter:title,twitter:description - X falls back to Open Graph tags (
og:title,og:image) if Twitter-specific tags are absent - Recommended image size for
summary_large_image: 1200×630 px, max 5 MB, JPG/PNG/WebP
Check
Inspect <head> for <meta name="twitter:card">, <meta name="twitter:title">, <meta name="twitter:description">, and <meta name="twitter:image">. Verify the card type is valid (summary or summary_large_image). Test the URL in the X Card Validator.
Fix
Add the required Twitter Card meta tags to the <head>. For article/blog pages use summary_large_image. Ensure twitter:image points to an absolute URL of an image at least 300×157 px (ideally 1200×630 px) under 5 MB.
Explain
Explain how Twitter Cards enhance shared links, the difference between summary and summary_large_image card types, and how X falls back to Open Graph tags.
Code Review
Review metadata generation, rendered HTML, structured data, and response headers related to Add Twitter Card meta tags. Flag exact routes or templates where search-facing output violates the rule, and describe how to verify the final page output.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/seo/twitter-cards
常见问题
summary 和 summary_large_image 有什么区别?
summary 卡片较小,而 summary_large_image 显示大图。这项技能建议文章使用大图版本。
图片应该多大?
这项技能推荐 1200 x 630 像素、小于 5 MB,格式为 JPG、PNG 或 WebP。
我能测试卡片的显示效果吗?
可以。这项技能建议在 X Card Validator 中测试网址。
详情
作者的原始描述
Use when applies to any page intended to be shared on X (Twitter). Use when auditing social sharing previews or adding social meta tags to a new site.
热度
- GitHub 星标
- 75k
- 排名
- #3065
- 许可证
- MIT
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
frontendchecklist
75k使用命令行工具,依据 380 多条关于无障碍、速度、SEO 和安全的规则,检查前端代码和线上页面。
frontend-checklist-global
75k依据全部 386 条 Front-End Checklist 规则审查前端项目,并为发现的每个问题给出具体修复方法。
404-page
75k检查你的页面缺失提示是否提供有用的链接,并返回真正的 404 状态,帮助迷路的访客找到方向。
about-page
75k审查你的网站是否有清晰的关于页面,说明由谁运营,以建立访客和搜索引擎的信任。