mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-08-21 05:51:46 +10:00
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.
This commit is contained in:
@@ -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) =>
|
||||
|
||||
@@ -73,12 +73,13 @@ export const Route = createRootRouteWithContext<RouterContext>()({
|
||||
{ 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 },
|
||||
|
||||
Reference in New Issue
Block a user