Tagi OG nie wpływają na ranking, ale decydują, czy ktokolwiek kliknie twój link na LinkedInie, Slacku, Telegramie czy X. Tagi ogarnia Metadata API:
export const metadata: Metadata = {
openGraph: {
title: "Checklista SEO dla Next.js",
description: "Każda warstwa SEO w App Routerze.",
type: "article",
images: [{ url: "/og/next-seo-checklist.png", width: 1200, height: 630 }],
},
twitter: {
card: "summary_large_image",
},
};
Niedoceniana funkcja: generowane obrazki OG. Połóż plik opengraph-image.tsx obok dowolnej trasy, a Next.js wyrenderuje obrazek 1200×630 na edge — bez grafika do każdego wpisu:
// app/blog/[slug]/opengraph-image.tsx
import { ImageResponse } from "next/og";
export const size = { width: 1200, height: 630 };
export const contentType = "image/png";
export default async function OgImage({ params }) {
const post = await getPost(params.slug);
return new ImageResponse(
(
<div
style={{
display: "flex",
flexDirection: "column",
width: "100%",
height: "100%",
justifyContent: "center",
padding: 80,
background: "#0a0a0a",
color: "#fff",
}}
>
<div style={{ fontSize: 64, fontWeight: 700 }}>{post.title}</div>
<div style={{ fontSize: 28, marginTop: 24, color: "#a1a1aa" }}>
example.com/blog
</div>
</div>
),
size,
);
}
Checklista:
- OG title/description/image na każdej stronie wartej udostępnienia
- Obrazek 1200×630; tekst czytelny w rozmiarze miniatury
-
twitter.cardustawiony nasummary_large_image - Podgląd sprawdzony w opengraph.xyz lub LinkedIn Post Inspector