Skip to content

Commit

Permalink
Some minor fixes to SEO details
Browse files Browse the repository at this point in the history
  • Loading branch information
ruchernchong committed Dec 7, 2024
1 parent 1c2aea4 commit 6cb1b2e
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 12 deletions.
6 changes: 2 additions & 4 deletions app/(dashboard)/cars/makes/[make]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,16 @@ export const generateMetadata = async (props: {
const canonicalUrl = `/cars/makes/${make}`;

return {
metadataBase: new URL(SITE_URL),
title: formattedMake,
description,
openGraph: {
images: "/opengraph-image.png",
url: canonicalUrl,
siteName: SITE_TITLE,
locale: "en_SG",
type: "website",
},
twitter: {
card: "summary_large_image",
images: "/opengraph-image.png",
site: "@sgcarstrends",
creator: "@sgcarstrends",
},
Expand Down Expand Up @@ -81,10 +78,11 @@ const CarMakePage = async (props: { params: Params }) => {
const filteredCars = mergeCarData(cars);

const formattedMake = deslugify(make).toUpperCase();
const title = `${formattedMake} - ${SITE_TITLE}`;
const structuredData: WithContext<WebPage> = {
"@context": "https://schema.org",
"@type": "WebPage",
name: `${formattedMake} Car Registrations in Singapore`,
name: title,
description: `Historical trends and monthly breakdown of ${formattedMake} cars by fuel and vehicle types in Singapore.`,
url: `${SITE_URL}/cars/makes/${make}`,
publisher: {
Expand Down
2 changes: 1 addition & 1 deletion app/(dashboard)/cars/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const generateMetadata = async (props: {

const formattedMonth = formatDateToMonthYear(month);

const title = `${formattedMonth} Car Registrations in Singapore`;
const title = `Car Registrations in Singapore`;
const description = `Discover ${formattedMonth} car registrations in Singapore. See detailed stats by fuel type, vehicle type, and top brands.`;
const pageUrl = `/cars`;

Expand Down
3 changes: 0 additions & 3 deletions app/(dashboard)/coe/(prices)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,16 @@ export const generateMetadata = async (): Promise<Metadata> => {
// const images = "/api/og?title=COE Result";

return {
metadataBase: new URL(SITE_URL),
title,
description,
openGraph: {
images: "/opengraph-image.png",
url: pageUrl,
siteName: SITE_TITLE,
locale: "en_SG",
type: "website",
},
twitter: {
card: "summary_large_image",
images: "/opengraph-image.png",
site: "@sgcarstrends",
creator: "@sgcarstrends",
},
Expand Down
Binary file added app/(dashboard)/coe/opengraph-image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/(dashboard)/coe/twitter-image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 5 additions & 4 deletions app/(dashboard)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,21 @@ import type { Metadata } from "next";

const inter = Inter({ subsets: ["latin"] });

const title: string = SITE_TITLE;
const title = SITE_TITLE;
const description: string = `Statistics for car trends in Singapore. Data provided by Land Transport Authority (LTA)`;
const url = new URL(SITE_URL);

export const metadata: Metadata = {
metadataBase: url,
title,
title: {
template: `%s - ${title}`,
default: title,
},
description,
robots: { index: true, follow: true },
openGraph: {
title,
description,
images: "/opengraph-image.png",
url,
siteName: title,
locale: "en_SG",
Expand All @@ -36,7 +38,6 @@ export const metadata: Metadata = {
card: "summary_large_image",
title,
description,
images: "/opengraph-image.png",
site: "@sgcarstrends",
creator: "@sgcarstrends",
},
Expand Down
Binary file added app/(dashboard)/opengraph-image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/(dashboard)/twitter-image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6cb1b2e

Please sign in to comment.