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

twitter-cards

它能做什么

这项技能添加用于控制网页在 X 上被分享时外观的标签。适用于在社交媒体上分享链接的网站所有者和营销人员。

适用场景

  • ✓当在 X 上分享的页面只显示一个普通链接的时候。
  • ✓当新网站需要社交分享标签的时候。
  • ✓当分享的文章应当显示大图预览的时候。

技能链接

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/twitter-cards/SKILL.md

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

使用方法

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

可直接粘贴的消息

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

可以这样问 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.

repo: thedaviddias/Front-End-Checklist

热度

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

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能