Skip to content

Commit

Permalink
Fix opengraph image being cached with the old one
Browse files Browse the repository at this point in the history
  • Loading branch information
ruchernchong committed Aug 24, 2024
1 parent a5c9e2c commit 0cbf5b5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/cars/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,15 @@ export const generateMetadata = async (
const pageUrl = `/cars`;

const previousImages = (await parent).openGraph?.images || [];
const opengraphImage = `/opengraph-image.png`;
const twitterImage = `/twitter-image.png`;
// const images = `/api/og?title=Car Registrations for ${formattedDate}`;

return {
title: "Car Registrations",
description: `Breakdown of the cars registered in ${formattedDate} by fuel type and vehicle type`,
openGraph: { url: pageUrl, images: [...previousImages] },
twitter: { images: [...previousImages] },
openGraph: { url: pageUrl, images: opengraphImage },
twitter: { images: twitterImage },
alternates: {
canonical: pageUrl,
},
Expand Down

0 comments on commit 0cbf5b5

Please sign in to comment.