fix: add missing SEO to About and Contact pages
- Add keywords, canonical, OpenGraph to About page - Refactor Contact page to server component with generateMetadata - Create ContactPageClient for form functionality - All pages now have complete SEO coverage
This commit is contained in:
@@ -3,18 +3,42 @@ import Header from "@/components/layout/Header";
|
||||
import Footer from "@/components/layout/Footer";
|
||||
import { getPageMetadata } from "@/lib/i18n/pageMetadata";
|
||||
import { isValidLocale, DEFAULT_LOCALE, type Locale } from "@/lib/i18n/locales";
|
||||
import { getPageKeywords } from "@/lib/seo/keywords";
|
||||
import { Metadata } from "next";
|
||||
|
||||
const baseUrl = process.env.NEXT_PUBLIC_SITE_URL || "https://dev.manoonoils.com";
|
||||
|
||||
interface AboutPageProps {
|
||||
params: Promise<{ locale: string }>;
|
||||
}
|
||||
|
||||
export async function generateMetadata({ params }: AboutPageProps) {
|
||||
export async function generateMetadata({ params }: AboutPageProps): Promise<Metadata> {
|
||||
const { locale } = await params;
|
||||
const validLocale = isValidLocale(locale) ? locale : DEFAULT_LOCALE;
|
||||
const metadata = getPageMetadata(validLocale as Locale);
|
||||
const keywords = getPageKeywords(validLocale as Locale, 'about');
|
||||
|
||||
const localePrefix = validLocale === DEFAULT_LOCALE ? "" : `/${validLocale}`;
|
||||
const canonicalUrl = `${baseUrl}${localePrefix}/about`;
|
||||
|
||||
return {
|
||||
title: metadata.about.title,
|
||||
description: metadata.about.description,
|
||||
keywords: [...keywords.primary, ...keywords.secondary].join(', '),
|
||||
alternates: {
|
||||
canonical: canonicalUrl,
|
||||
},
|
||||
openGraph: {
|
||||
title: metadata.about.title,
|
||||
description: metadata.about.description,
|
||||
type: 'website',
|
||||
url: canonicalUrl,
|
||||
},
|
||||
twitter: {
|
||||
card: 'summary',
|
||||
title: metadata.about.title,
|
||||
description: metadata.about.description,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user