twitter | x.com don't show "summary_large_image" #78511
-
SummaryHey! I’ve been trying to fix this for 3 days now, but no luck. For comparison, Facebook renders it correctly (see attached screenshots), and LinkedIn also shows the preview as expected. Image details: Size: 1200x630 px Format: PNG I'd really appreciate any help, as I’ve been struggling with this and don’t think it’s something I broke — it used to work just fine. and here is something wird event when on my site i have this: <meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@thls">
<meta name="twitter:creator" content="@thelolos">
<meta name="twitter:title" content="Strony internetowe, które inspirują i generują zyski">
<meta name="twitter:description" content="Zbuduj swoją obecność w sieci z profesjonalną stroną internetową od Thls. Nasze strony są nie tylko estetyczne, ale także funkcjonalne i zoptymalizowane pod kątem SEO. Dzięki naszym usługom Tw...">
<meta name="twitter:image" content="https://thls.pl/opengraph4.png"> i even try to give image in format 1024x1024 and still... Additional informationtype Locale = "pl" | "en" | "uk" | "es" | "de" | "fr" | "it";
type Params = {
params: Promise<{
locale: Locale;
}>;
};
export async function generateMetadata(
{ params }: Params,
// parent: ResolvingMetadata
): Promise<Metadata> {
// read route params
const { locale } = await params;
const t = i18n[locale];
return {
title: t.title0,
description: t.desc0,
authors: [{ name: "TheLoloS", url: "https://thls.pl/" }],
creator: "TheLoloS",
alternates: {
canonical: `https://thls.pl/${locale}/services/website-create`,
},
publisher: "TheLoloS",
openGraph: {
type: "website",
title: t.title0,
description: t.desc0,
siteName: t.title0,
locale: locale,
url: isProduction
? `https://thls.pl/${locale}/services/website-create`
: `http://localhost:3000/${locale}/services/website-create`,
images: ["/opengraph4.png"],
},
twitter: {
card: "summary_large_image",
site: "@thls",
title: t.title0,
description: t.desc0,
creator: "@thelolos",
images: isProduction
? "https://thls.pl/opengraph4.png"
: "http://localhost:3000/opengraph4.png",
},
};
} ExampleNo response |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
i had the same issue, but Solved by correctly including (and making sure it is SSR provided in initial document): following properties of Metadata.twitter.images I suggest to close issue#78511 PS: Next 15.3.4 |
Beta Was this translation helpful? Give feedback.
-
@TheLoloS try to use TwitterImageDescriptor instead of string and provide TwitterImageDescriptor : type, width, height. NOTE
|
Beta Was this translation helpful? Give feedback.
-
Yeep its work! for the future: twitter: {
card: "summary_large_image",
site: "@thls",
title: t.title,
description: t.desc,
creator: "@thelolos",
images: {
type: "image/png",
alt: t.title,
secureUrl: isProduction
? "https://thls.pl/opengraph4.png"
: "http://localhost:3000/opengraph4.png",
width: 1200,
height: 630,
url: isProduction
? "https://thls.pl/opengraph4.png"
: "http://localhost:3000/opengraph4.png",
},
} Thank you <3 |
Beta Was this translation helpful? Give feedback.
@TheLoloS try to use TwitterImageDescriptor instead of string and provide TwitterImageDescriptor : type, width, height.
If still do not work, make sure that file-generated twitter-image is set up correctly (if you use App Router): https://nextjs.org/docs/app/api-reference/file-conventions/metadata/opengraph-image
NOTE