Skip to content

Commit

Permalink
Update social media image previews
Browse files Browse the repository at this point in the history
  • Loading branch information
ruchernchong committed Dec 2, 2024
1 parent af247b6 commit f6f1735
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 17 deletions.
9 changes: 6 additions & 3 deletions app/(dashboard)/cars/fuel-types/[fuelType]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,28 @@ export const generateMetadata = async (props: {
const formattedFuelType = deslugify(fuelType);
const title = `${formattedFuelType} Cars in Singapore`;
const description = `Explore registration trends and statistics for ${formattedFuelType} cars in Singapore.`;
const images = `${SITE_URL}/api/og?type=${fuelType}&month=${month}`;
// const images = `/api/og?type=${fuelType}&month=${month}`;
const pageUrl = `/cars/fuel-types/${fuelType}`;

return {
metadataBase: new URL(SITE_URL),
title,
description,
openGraph: {
title,
description,
images,
images: "/opengraph-image.png",
url: pageUrl,
siteName: SITE_TITLE,
locale: "en_SG",
type: "website",
},
twitter: {
card: "summary_large_image",
title,
description,
images,
images: "/opengraph-image.png",
site: "@sgcarstrends",
creator: "@sgcarstrends",
},
alternates: {
Expand Down
9 changes: 6 additions & 3 deletions app/(dashboard)/cars/makes/[make]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,24 @@ export const generateMetadata = async (props: {

const formattedMake = deslugify(make).toUpperCase();
const description = `Historical trends and monthly breakdown of ${formattedMake} cars by fuel and vehicle types in Singapore.`;
const images = `/api/og?title=Historical Trend&make=${make}`;
// const images = `/api/og?title=Historical Trend&make=${make}`;
const canonicalUrl = `/cars/makes/${make}`;

return {
metadataBase: new URL(SITE_URL),
title: formattedMake,
description,
openGraph: {
images,
images: "/opengraph-image.png",
url: canonicalUrl,
siteName: SITE_TITLE,
locale: "en_SG",
type: "website",
},
twitter: {
images,
card: "summary_large_image",
images: "/opengraph-image.png",
site: "@sgcarstrends",
creator: "@sgcarstrends",
},
alternates: {
Expand Down
9 changes: 5 additions & 4 deletions app/(dashboard)/cars/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,21 @@ export const generateMetadata = async (props: {
// const images = `/api/og?title=Car Registrations for ${formattedMonth}`;

return {
metadataBase: new URL(SITE_URL),
title,
description,
openGraph: {
title,
description,
images: "/opengraph-image.png",
url: pageUrl,
siteName: SITE_TITLE,
locale: "en_SG",
type: "website",
},
twitter: {
title,
description,
card: "summary_large_image",
images: "/opengraph-image.png",
site: "@sgcarstrends",
creator: "@sgcarstrends",
},
alternates: {
canonical: pageUrl,
Expand Down
9 changes: 6 additions & 3 deletions app/(dashboard)/cars/vehicle-types/[vehicleType]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,24 @@ export const generateMetadata = async (props: {
const { vehicleType } = params;

const formattedVehicleType = deslugify(vehicleType);
const images = `/api/og?title=Historical Trend&type=${vehicleType}`;
// const images = `/api/og?title=Historical Trend&type=${vehicleType}`;
const canonicalUrl = `/cars/vehicle-types/${vehicleType}`;

return {
metadataBase: new URL(SITE_URL),
title: `${formattedVehicleType} Cars in Singapore`,
description: `Explore registration trends and statistics for ${formattedVehicleType} cars in Singapore.`,
openGraph: {
images,
images: "/opengraph-image.png",
url: canonicalUrl,
siteName: SITE_TITLE,
locale: "en_SG",
type: "website",
},
twitter: {
images,
card: "summary_large_image",
images: "/opengraph-image.png",
site: "@sgcarstrends",
creator: "@sgcarstrends",
},
alternates: {
Expand Down
Binary file removed app/(dashboard)/coe/(prices)/opengraph-image.png
Binary file not shown.
10 changes: 6 additions & 4 deletions app/(dashboard)/coe/(prices)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,24 @@ const description =

export const generateMetadata = async (): Promise<Metadata> => {
const pageUrl = "/coe";
// const images = "/api/og?title=COE Result";

return {
metadataBase: new URL(SITE_URL),
title,
description,
openGraph: {
images: "/opengraph-image.png",
url: pageUrl,
title: "COE Dashboard",
description,
siteName: SITE_TITLE,
locale: "en_SG",
type: "website",
},
twitter: {
card: "summary_large_image",
title,
description,
images: "/opengraph-image.png",
site: "@sgcarstrends",
creator: "@sgcarstrends",
},
alternates: {
canonical: pageUrl,
Expand Down
Binary file removed app/(dashboard)/coe/(prices)/twitter-image.png
Binary file not shown.
2 changes: 2 additions & 0 deletions app/(dashboard)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const metadata: Metadata = {
openGraph: {
title,
description,
images: "/opengraph-image.png",
url,
siteName: title,
locale: "en_SG",
Expand All @@ -36,6 +37,7 @@ export const metadata: Metadata = {
card: "summary_large_image",
title,
description,
images: "/opengraph-image.png",
site: "@sgcarstrends",
creator: "@sgcarstrends",
},
Expand Down
Binary file removed app/(dashboard)/opengraph-image.png
Binary file not shown.
Binary file removed app/(dashboard)/twitter-image.png
Binary file not shown.
File renamed without changes
File renamed without changes

0 comments on commit f6f1735

Please sign in to comment.