generate-metadata

Generates OpenGraph, Twitter Card, and JSON-LD metadata for Next.js pages.

1|Updated Feb 1, 2025
One-click install
npx skills add https://github.com/TiagoDanin/TiagoDanin.github.io --skill generate-metadata-tiagodanin
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: generate-metadata
Source: https://github.com/TiagoDanin/TiagoDanin.github.io/tree/main/.claude/skills/generate-metadata
Command: npx skills add https://github.com/TiagoDanin/TiagoDanin.github.io --skill generate-metadata-tiagodanin

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Creating consistent, standards-compliant SEO metadata for every page in a Next.js site is repetitive and error-prone. This Skill standardizes the generation of OpenGraph tags, Twitter Cards, and JSON-LD structured data so new dynamic pages ship with complete metadata. ## Core Features & Use Cases - Complete Metadata Templates: Provides ready-to-use TypeScript patterns for basic metadata, OpenGraph, Twitter Card, and JSON-LD structured data. - Schema.org Type Selection: Includes JSON-LD templates for BlogPosting, PresentationDigitalDocument (talks), and Event (timeline entries) types. - Validation Checklist: Enforces rules like 160-character descriptions, absolute canonical URLs, and 1200x630 OpenGraph images. - Use Case: When adding a new dynamic route like src/app/talks/[slug]/, use this Skill to generate the generateMetadata() function and inject the JSON-LD script into the page component. ## Quick Start Generate the SEO metadata and JSON-LD structured data for a new dynamic page in src/app using the generate-metadata skill.

Frequently Asked Questions about generate-metadata

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add SEO metadata to a Next.js dynamic page?

Export an async generateMetadata function from the page file that returns a Next.js Metadata object with title, description, openGraph, and twitter fields. Look up the item by slug from params and return a Not Found fallback when no match exists.

How to add JSON-LD structured data in Next.js?

Build a schema.org object such as BlogPosting in the page component and render it inside a script tag with type application/ld+json using dangerouslySetInnerHTML with JSON.stringify. Convert dates to ISO 8601 format before including them.

What OpenGraph image size should I use for Twitter Cards?

Use a 1200 by 630 pixel image, which is the recommended size for both OpenGraph and Twitter summary_large_image cards. Reference it with an absolute URL and include a descriptive alt attribute.

Which schema.org type should I use for blog posts and talks?

Use BlogPosting for blog articles, PresentationDigitalDocument for talks and presentations, and Event for timeline entries. Each type requires specific fields like headline, datePublished, and author.

Why is my meta description truncated in search results?

Search engines typically display around 160 characters, so longer descriptions get cut off. Truncate descriptions to 157 characters plus an ellipsis before returning them from generateMetadata to control the visible text.