From 1e23a453a0db53bb17827d9789fc2ccc1886dd98 Mon Sep 17 00:00:00 2001 From: Amruth Pillai Date: Mon, 17 Aug 2026 22:19:52 +0200 Subject: [PATCH] fix(seo): declare Twitter card tags with name attributes X reads twitter:* meta tags from the name attribute, not property, so the card validator reported twitter:title and twitter:description as missing. Also adds the og:type tag the root head was never emitting. --- apps/web/src/libs/seo.ts | 9 +++++---- apps/web/src/routes/__root.tsx | 11 ++++++----- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/apps/web/src/libs/seo.ts b/apps/web/src/libs/seo.ts index 3b8982c2f..f22671772 100644 --- a/apps/web/src/libs/seo.ts +++ b/apps/web/src/libs/seo.ts @@ -30,10 +30,11 @@ export const createResumeSocialMeta = ({ canonicalUrl, title, description, image { property: "og:description", content: description }, { property: "og:url", content: canonicalUrl }, { property: "og:image", content: imageUrl }, - { property: "twitter:card", content: "summary_large_image" }, - { property: "twitter:title", content: title }, - { property: "twitter:description", content: description }, - { property: "twitter:image", content: imageUrl }, + // X only reads these as `name`, not `property` + { name: "twitter:card", content: "summary_large_image" }, + { name: "twitter:title", content: title }, + { name: "twitter:description", content: description }, + { name: "twitter:image", content: imageUrl }, ]; const serializeJsonLdForScript = (data: JsonLd) => diff --git a/apps/web/src/routes/__root.tsx b/apps/web/src/routes/__root.tsx index 1f69b36e2..689f16dc7 100644 --- a/apps/web/src/routes/__root.tsx +++ b/apps/web/src/routes/__root.tsx @@ -73,12 +73,13 @@ export const Route = createRootRouteWithContext()({ { name: "apple-mobile-web-app-capable", content: "yes" }, { name: "apple-mobile-web-app-title", content: "Reactive Resume" }, { name: "apple-mobile-web-app-status-bar-style", content: "black-translucent" }, - // Twitter Tags - { property: "twitter:image", content: `${appUrl}/opengraph/banner.jpg` }, - { property: "twitter:card", content: "summary_large_image" }, - { property: "twitter:title", content: title }, - { property: "twitter:description", content: description }, + // Twitter Tags — X only reads these as `name`, not `property` + { name: "twitter:image", content: `${appUrl}/opengraph/banner.jpg` }, + { name: "twitter:card", content: "summary_large_image" }, + { name: "twitter:title", content: title }, + { name: "twitter:description", content: description }, // OpenGraph Tags + { property: "og:type", content: "website" }, { property: "og:image", content: `${appUrl}/opengraph/banner.jpg` }, { property: "og:site_name", content: appName }, { property: "og:title", content: title },