Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

fix(docsite): serve blog cover + social banner from the asset CDN (#3383)

rubyycheung7d7d3ed55328
diff --git a/apps/docsite/public/astryx-og-banner.png b/apps/docsite/public/astryx-og-banner.png
deleted file mode 100644
index 25c0b95598..0000000000
Binary files a/apps/docsite/public/astryx-og-banner.png and /dev/null differ
diff --git a/apps/docsite/src/__tests__/pageMetadata.test.ts b/apps/docsite/src/__tests__/pageMetadata.test.ts
index 66a0bf5bba..6eb205773c 100644
--- a/apps/docsite/src/__tests__/pageMetadata.test.ts
+++ b/apps/docsite/src/__tests__/pageMetadata.test.ts
@@ -47,10 +47,8 @@ describe('pageMetadata', () => {
});
it('re-states the branded social image on both cards', () => {
- expect(JSON.stringify(meta.openGraph?.images)).toContain(
- 'astryx-og-banner',
- );
- expect(JSON.stringify(meta.twitter?.images)).toContain('astryx-og-banner');
+ expect(JSON.stringify(meta.openGraph?.images)).toContain('Astryx-Banner');
+ expect(JSON.stringify(meta.twitter?.images)).toContain('Astryx-Banner');
});
it('defaults the OpenGraph type to website', () => {
diff --git a/apps/docsite/src/app/blog/[slug]/page.tsx b/apps/docsite/src/app/blog/[slug]/page.tsx
index 149b0b535d..92849d77ec 100644
--- a/apps/docsite/src/app/blog/[slug]/page.tsx
+++ b/apps/docsite/src/app/blog/[slug]/page.tsx
@@ -30,7 +30,9 @@ export async function generateMetadata({
// fall back to the branded default card. Next.js shallow-merges metadata —
// a route that sets `openGraph`/`twitter` replaces the root object wholesale
// (images are not inherited), so the fallback must be explicit here.
- const ogImage = post.coverImage ?? '/astryx-og-banner.png';
+ const ogImage =
+ post.coverImage ??
+ 'https://lookaside.facebook.com/assets/astryx/Astryx-Banner.png';
const ogAlt = post.coverImage ? (post.coverAlt ?? post.title) : post.title;
return {
diff --git a/apps/docsite/src/app/blog/page.tsx b/apps/docsite/src/app/blog/page.tsx
index 6eae836628..dd5e82f54b 100644
--- a/apps/docsite/src/app/blog/page.tsx
+++ b/apps/docsite/src/app/blog/page.tsx
@@ -26,13 +26,13 @@ export const metadata: Metadata = {
title: `${BLOG_TITLE} · Astryx`,
description: BLOG_DESCRIPTION,
url: '/blog',
- images: ['/astryx-og-banner.png'],
+ images: ['https://lookaside.facebook.com/assets/astryx/Astryx-Banner.png'],
},
twitter: {
card: 'summary_large_image',
title: `${BLOG_TITLE} · Astryx`,
description: BLOG_DESCRIPTION,
- images: ['/astryx-og-banner.png'],
+ images: ['https://lookaside.facebook.com/assets/astryx/Astryx-Banner.png'],
},
};
diff --git a/apps/docsite/src/app/layout.tsx b/apps/docsite/src/app/layout.tsx
index ea0bc13351..93f78bb805 100644
--- a/apps/docsite/src/app/layout.tsx
+++ b/apps/docsite/src/app/layout.tsx
@@ -25,7 +25,8 @@ import {
// Default social card image: the launch banner that the announcement blog post
// uses for its cover. Reusing the same branded banner keeps the shared-link
// preview consistent with the launch creative across the site and the post.
-const OG_IMAGE = '/astryx-og-banner.png';
+const OG_IMAGE =
+ 'https://lookaside.facebook.com/assets/astryx/Astryx-Banner.png';
export const metadata: Metadata = {
metadataBase: new URL(SITE_URL),
@@ -51,8 +52,8 @@ export const metadata: Metadata = {
images: [
{
url: OG_IMAGE,
- width: 1200,
- height: 675,
+ width: 2400,
+ height: 1260,
alt: 'Astryx — an open source design system by Meta',
},
],
diff --git a/apps/docsite/src/content/blog/posts/introducing-astryx.md b/apps/docsite/src/content/blog/posts/introducing-astryx.md
index 41ae6e85a7..a9d6a3bc22 100644
--- a/apps/docsite/src/content/blog/posts/introducing-astryx.md
+++ b/apps/docsite/src/content/blog/posts/introducing-astryx.md
@@ -9,7 +9,7 @@ tags:
- 'Release'
- 'AI'
- 'Design systems'
-coverImage: '/astryx-og-banner.png'
+coverImage: 'https://lookaside.facebook.com/assets/astryx/Astryx-Banner.png'
coverAlt: 'Introducing Astryx by Meta'
relatedDocs:
- title: 'Getting started'
diff --git a/apps/docsite/src/lib/pageMetadata.ts b/apps/docsite/src/lib/pageMetadata.ts
index 68a1eaf865..c22f93a22d 100644
--- a/apps/docsite/src/lib/pageMetadata.ts
+++ b/apps/docsite/src/lib/pageMetadata.ts
@@ -20,7 +20,8 @@ import type {Metadata} from 'next';
import {SITE_NAME} from './siteConfig';
/** Branded launch banner that matches the root layout + blog fallback card. */
-const DEFAULT_OG_IMAGE = '/astryx-og-banner.png';
+const DEFAULT_OG_IMAGE =
+ 'https://lookaside.facebook.com/assets/astryx/Astryx-Banner.png';
export interface PageMetadataInput {
/** Plain page title; rendered as "<title> · Astryx" via the root template. */