@@ -23,6 +23,12 @@ interface LandingMetadataInput {
2323 twitterImageAlt ?: string
2424 /** RSS feed path advertised through `<link rel="alternate">`, e.g. "/changelog.xml". */
2525 feedPath ?: string
26+ /**
27+ * The route renders its own card from a sibling `opengraph-image`. The shared
28+ * image is then left out, because an explicit `images` entry would replace the
29+ * route's card on X and Slack, where `twitter:image` falls back to it.
30+ */
31+ routeImage ?: boolean
2632}
2733
2834/**
@@ -31,9 +37,10 @@ interface LandingMetadataInput {
3137 * landing family, so per-page files declare only what actually varies (title,
3238 * description, keywords, path, and any non-default image alt).
3339 *
34- * Note: dynamic and image-bearing routes that resolve their card from a sibling
35- * `opengraph-image` (integrations, models) and the blog family (`buildPostMetadata`
36- * in `lib/blog/seo`) intentionally do not use this helper.
40+ * Note: the integration and model routes, which resolve their card from a sibling
41+ * `opengraph-image`, and the blog family (`buildPostMetadata` in `lib/blog/seo`)
42+ * intentionally do not use this helper. A route that otherwise fits it but has its
43+ * own card passes `routeImage`.
3744 */
3845export function buildLandingMetadata ( {
3946 title,
@@ -43,6 +50,7 @@ export function buildLandingMetadata({
4350 imageAlt,
4451 twitterImageAlt,
4552 feedPath,
53+ routeImage = false ,
4654} : LandingMetadataInput ) : Metadata {
4755 const url = `${ SITE_URL } ${ path } `
4856 const ogAlt = imageAlt ?? title
@@ -63,20 +71,15 @@ export function buildLandingMetadata({
6371 url,
6472 siteName : 'Sim' ,
6573 locale : 'en_US' ,
66- images : [
67- {
68- ...LANDING_SOCIAL_IMAGE ,
69- alt : ogAlt ,
70- } ,
71- ] ,
74+ ...( routeImage ? { } : { images : [ { ...LANDING_SOCIAL_IMAGE , alt : ogAlt } ] } ) ,
7275 } ,
7376 twitter : {
7477 card : 'summary_large_image' ,
7578 site : '@simdotai' ,
7679 creator : '@simdotai' ,
7780 title,
7881 description,
79- images : { url : LANDING_SOCIAL_IMAGE . url , alt : twitterAlt } ,
82+ ... ( routeImage ? { } : { images : { url : LANDING_SOCIAL_IMAGE . url , alt : twitterAlt } } ) ,
8083 } ,
8184 alternates : {
8285 canonical : url ,
0 commit comments