当用户想要添加或优化用于社交分享的Open Graph元数据时使用。当用户提到“Open Graph”、“og:tags”、“og:title”、“og:image”等时也适用。
Guides implementation of Open Graph meta tags for social media previews (Facebook, LinkedIn, Slack, Discord, etc.). Pages with proper OG tags get 2–3× more clicks than bare URL links.
When invoking: On first use, if helpful, open with 1–2 sentences on what this skill covers and why it matters, then provide the main output. On subsequent use or when the user asks to skip, go directly to the main output.
Every shareable page requires these minimum tags:
html
<meta property="og:title" content="Your Page Title">
<meta property="og:description" content="Your description">
<meta property="og:image" content="https://yourdomain.com/image.png">
<meta property="og:url" content="https://yourdomain.com/page">
TagGuidelineog:titleKeep under 60 chars; compelling; match page contentog:description150–200 chars; conversion-focusedog:imageAbsolute URL (https://); 1200×630px recommendedog:urlCanonical URL; deduplicates shares
TagPurposeog:typeContent type: website, article, video, productog:site_nameWebsite name; displayed separately from titleog:image:width / og:image:heightImage dimensions (1200×630px)og:image:altAlt text for accessibilityog:localeLanguage/territory (e.g., en_US); for multilingual sites
ItemGuidelineSize1200×630px (1.91:1 ratio) for Facebook, LinkedIn, WhatsAppFormatJPG, PNG, WebP; under 5MBURLAbsolute URL with https://; no relative pathsUniqueOne unique image per page when possible
tsx
export const metadata = {
openGraph: {
title: '...',
description: '...',
url: 'https://example.com/page',
siteName: 'Example',
images: [{ url: 'https://example.com/og.jpg', width: 1200, height: 630, alt: '...' }],
locale: 'en_US',
type: 'website',
},
};
html
<meta property="og:title" content="Your Title">
<meta property="og:description" content="Your description">
<meta property="og:image" content="https://example.com/og.jpg">
<meta property="og:url" content="https://example.com/page">
<meta property="og:type" content="website">
<meta property="og:site_name" content="Your Site">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta property="og:image:alt" content="Alt text">
article for article/post pages; article-specific tags (published_time, author)