diff --git a/app/api/og/route.tsx b/app/api/og/route.tsx
index 10809fca2..fd2ae6301 100644
--- a/app/api/og/route.tsx
+++ b/app/api/og/route.tsx
@@ -3,151 +3,158 @@ import { NextRequest } from 'next/server';
export const runtime = 'edge';
+const OG_IMAGE_SIZE = { width: 1200, height: 630 };
+
export async function GET(request: NextRequest) {
const { searchParams } = new URL(request.url);
const title = searchParams.get('title');
const description = searchParams.get('description');
const author = searchParams.get('author');
const type = searchParams.get('type') || 'article';
+ const image = searchParams.get('image');
+
+ if (image) {
+ return new ImageResponse(
+
+ {/* Background pattern */}
+
+
+ {/* Logo and brand */}
- {/* Background pattern */}
-
+
- {/* Logo and brand */}
+ {/* Content type badge */}
+ {type && (
-

+ {type}
+ )}
- {/* Content type badge */}
- {type && (
-
- {type}
-
- )}
-
- {/* Title */}
- {title && (
-
- {title}
-
- )}
+ {/* Title */}
+ {title && (
+
+ {title}
+
+ )}
- {/* Description */}
- {description && (
-
- {description}
-
- )}
+ {/* Description */}
+ {description && (
+
+ {description}
+
+ )}
- {/* Author */}
- {author && (
+ {/* Author */}
+ {author && (
+
-
- {author.charAt(0).toUpperCase()}
-
-
By {author}
+ {author.charAt(0).toUpperCase()}
- )}
-
- ),
- {
- width: 1200,
- height: 630,
- }
+
By {author}
+
+ )}
+ ,
+ OG_IMAGE_SIZE
);
}
diff --git a/app/grant/[id]/[slug]/page.tsx b/app/grant/[id]/[slug]/page.tsx
index 1b0b345c5..102bb8630 100644
--- a/app/grant/[id]/[slug]/page.tsx
+++ b/app/grant/[id]/[slug]/page.tsx
@@ -2,6 +2,7 @@ import { Metadata } from 'next';
import { notFound } from 'next/navigation';
import { PostService } from '@/services/post.service';
import { getWorkMetadata } from '@/lib/metadata-helpers';
+import { SITE_CONFIG } from '@/lib/metadata';
import { GrantContentSwitcher } from '@/components/Funding/GrantContentSwitcher';
interface Props {
@@ -25,8 +26,10 @@ async function getGrant(id: string) {
export async function generateMetadata({ params }: Props): Promise