Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some minor fixes to SEO details #179

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions app/(dashboard)/cars/makes/[make]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,29 +31,29 @@ export const generateMetadata = async (props: {
const { make } = params;

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

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

const formattedMake = deslugify(make).toUpperCase();
const title = `${formattedMake} Cars Overview: Registration Trends - ${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.
Loading