Zum Inhalt springen
Skillpedia
Social Media48k · #5821

social-metadata-hardening

Was er macht

Dieses Tool sorgt dafür, dass Links, die du in sozialen Netzwerken und Messenger-Apps teilst, mit einer schönen, vollständigen Vorschau erscheinen, statt nur als nackter Link. Es behebt Probleme wie fehlende Bilder, falsche Texte oder veraltete Vorschauen.

Wann du ihn nutzt

  • ✓Wenn ein geteilter Link kein Bild oder das falsche Bild anzeigt.
  • ✓Wenn die Link-Vorschau genau so aussehen soll, wie du es dir vorgestellt hast.
  • ✓Bevor du eine Website veröffentlichst, damit alle Links überall gut aussehen.

Link zum Skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/social-metadata-hardening/SKILL.md

Kopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.

So nutzt du ihn

Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.

Fertige Nachricht zum Einfügen

Nutze diesen Skill, um mir zu helfen: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/social-metadata-hardening/SKILL.md Lies die SKILL.md unter diesem Link und folge ihren Anweisungen für meine Aufgabe.
Soll deine KI Skills wie diesen selbst finden?Installiere den kostenlosen Skillpedia-MCP: eine Zeile, und sie durchsucht vor jeder Aufgabe 15.000+ Skills.In 1 Minute installieren →

Beispielanfrage an deine KI

“Sorge dafür, dass meine Website-Links auf Facebook und WhatsApp schöne Vorschauen anzeigen.”

5 neue Skills pro Woche. 1 Minute Lesezeit.

So funktioniert es

Das Tool ergänzt wichtige Informationen (wie Titel, Beschreibung und Bild) im Code deiner Website. Außerdem sorgt es dafür, dass die verwendeten Bilder die richtige Größe haben und in einem Format vorliegen, das die Social-Media-Plattformen verstehen.

Technischer Inhalt (originale SKILL.md)

Originaltext des Autors, auf Englisch, direkt von GitHub.

Social Metadata Hardening Skill

Fix social sharing so every important URL unfurls as a rich card across all platforms.


When to Use

  • Use when shared links show missing, stale, cropped, or incorrect previews on social and chat platforms.
  • Use when auditing Open Graph, Twitter/X card, image URL, alt text, or metadataBase coverage in a web app.
  • Use before launch when every public page needs predictable rich previews across LinkedIn, X, Facebook, WhatsApp, Slack, Discord, and Telegram.

Why Previews Break

Problem Root Cause
No preview at all Missing og:title, og:description, or og:image
Broken image Relative URL (must be absolute)
Wrong image size Image not 1200×630px (OG standard)
Plain text card Twitter card type missing or set to summary
Stale preview Platform caching old metadata
Metadata missing on crawl Tags added by client-side JS (crawlers don't run JS)

The Gold Standard Metadata Block

Every shareable page needs ALL of these in static HTML:

// Next.js App Router — lib/socialMetadata.js
export function buildSocialMetadata({
  title,
  description,
  path,          // '/blog/my-post'
  image,         // '/images/og/my-post.jpg' or full URL
  imageAlt,
  imageWidth = 1200,
  imageHeight = 630,
}) {
  const baseUrl = process.env.NEXT_PUBLIC_BASE_URL || 'https://www.yourdomain.com';
  
  // Always produce an absolute URL
  const imageUrl = image?.startsWith('http') ? image : `${baseUrl}${image}`;
  const pageUrl  = `${baseUrl}${path}`;
  
  // Detect MIME type from extension
  const ext = imageUrl.split('.').pop().toLowerCase();
  const mimeMap = { jpg: 'image/jpeg', jpeg: 'image/jpeg', png: 'image/png', webp: 'image/webp' };
  const imageType = mimeMap[ext] || 'image/jpeg';

  return {
    title,
    description,
    alternates: { canonical: pageUrl },
    openGraph: {
      title,
      description,
      url: pageUrl,
      type: 'website',  // use 'article' for blog posts
      images: [{
        url: imageUrl,
        secureUrl: imageUrl,   // explicit HTTPS version
        width: imageWidth,
        height: imageHeight,
        alt: imageAlt || title,
        type: imageType,
      }],
    },
    twitter: {
      card: 'summary_large_image',  // NOT 'summary' — that shows a tiny image
      title,
      description,
      images: [imageUrl],
    },
  };
}

Applying the Helper

Static page

// app/about/page.js
import { buildSocialMetadata } from '@/lib/socialMetadata';

export const metadata = buildSocialMetadata({
  title: 'About Us | My Site',
  description: 'Learn about our team and mission.',
  path: '/about',
  image: '/images/og/about.jpg',
  imageAlt: 'The My Site team',
});

Dynamic page (blog post, tool page)

// app/blog/[slug]/page.js
import { buildSocialMetadata } from '@/lib/socialMetadata';

export async function generateMetadata({ params }) {
  const post = await getPost(params.slug);
  return buildSocialMetadata({
    title: `${post.title} | My Blog`,
    description: post.excerpt,
    path: `/blog/${params.slug}`,
    image: post.ogImage || '/images/og/default.jpg',
    imageAlt: post.title,
  });
}

Homepage (app/layout.js or app/page.js)

export const metadata = {
  metadataBase: new URL('https://www.yourdomain.com'), // REQUIRED for absolute URLs
  ...buildSocialMetadata({
    title: 'My Site — Tagline Here',
    description: 'Site-wide description.',
    path: '/',
    image: '/images/og/home.jpg',
  }),
};

⚠️ Set metadataBase when using relative metadata URLs. If your helper already outputs absolute canonical/OG URLs, previews can still work without it.


OG Image Checklist

Good OG images:

  • 1200 × 630px (2:1 ratio — works on all platforms)
  • Under 8MB (Facebook limit)
  • Served over HTTPS
  • File name has no spaces (use hyphens)
  • Format: JPEG or PNG (WebP works on most but not all crawlers)
  • Accessible via GET with no authentication
# Verify your OG image is reachable and correct size
curl -sI https://www.yourdomain.com/images/og/home.jpg | grep -i "content-type\|content-length\|status"

Platform-Specific Notes

Facebook / Meta

  • Caches aggressively — use the Sharing Debugger to force recrawl
  • Minimum image: 200×200px (but use 1200×630 for quality)
  • Needs: og:title, og:description, og:image, og:url

…

Häufige Fragen

Warum ist meine Link-Vorschau kaputt?

Das kann aus mehreren Gründen passieren: Wichtige Informationen (Titel, Beschreibung, Bild) fehlen, das Bild ist als relativer Link angegeben (es braucht aber eine vollständige URL), das Bild hat die falsche Größe, oder die Plattform zeigt noch alte Informationen aus dem Cache an.

Wie groß sollte das Vorschaubild idealerweise sein?

Empfohlen sind 1200 Pixel Breite und 630 Pixel Höhe. So sieht das Bild auf allen Plattformen gut aus.

Wie aktualisiere ich die Vorschau, wenn ich den Link schon geteilt habe?

Nachdem du das Problem auf deiner Website behoben hast, kannst du plattformeigene Tools nutzen, zum Beispiel den Facebook-Debugger oder den Card Validator von Twitter/X. Damit forderst du die Plattform auf, die aktualisierten Informationen für den Link neu abzurufen.

Details

Originalbeschreibung des Autors

Fix social sharing previews so URLs render as rich cards on Facebook, LinkedIn, X/Twitter, WhatsApp, Telegram, and more. Covers OG tags, Twitter cards, absolute image URLs, and debugging.

repo: sickn33/agentic-awesome-skills

Beliebtheit

GitHub-Sterne
48k
Platz im Ranking
#5821
Lizenz
MIT
Aktualisiert
15.10.2026

Ist dieser Skill nützlich?

0

Anmelden um abzustimmen.

Kommentare

  • …

Weitere Skills aus diesem Repository

Ähnliche Skills