Includes canonical URL fix and build workflow improvements
This commit is contained in:
@@ -19,7 +19,7 @@ export async function generateMetadata({ params }: AboutPageProps): Promise<Meta
|
|||||||
const metadata = getPageMetadata(validLocale as Locale);
|
const metadata = getPageMetadata(validLocale as Locale);
|
||||||
const keywords = getPageKeywords(validLocale as Locale, 'about');
|
const keywords = getPageKeywords(validLocale as Locale, 'about');
|
||||||
|
|
||||||
const localePrefix = validLocale === DEFAULT_LOCALE ? "" : `/${validLocale}`;
|
const localePrefix = `/${validLocale}`;
|
||||||
const canonicalUrl = `${baseUrl}${localePrefix}/about`;
|
const canonicalUrl = `${baseUrl}${localePrefix}/about`;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export async function generateMetadata({ params }: ContactPageProps): Promise<Me
|
|||||||
const metadata = getPageMetadata(validLocale as Locale);
|
const metadata = getPageMetadata(validLocale as Locale);
|
||||||
const keywords = getPageKeywords(validLocale as Locale, 'contact');
|
const keywords = getPageKeywords(validLocale as Locale, 'contact');
|
||||||
|
|
||||||
const localePrefix = validLocale === DEFAULT_LOCALE ? "" : `/${validLocale}`;
|
const localePrefix = `/${validLocale}`;
|
||||||
const canonicalUrl = `${baseUrl}${localePrefix}/contact`;
|
const canonicalUrl = `${baseUrl}${localePrefix}/contact`;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -21,11 +21,11 @@ export async function generateMetadata({
|
|||||||
}): Promise<Metadata> {
|
}): Promise<Metadata> {
|
||||||
const { locale } = await params;
|
const { locale } = await params;
|
||||||
const validLocale = isValidLocale(locale) ? locale : DEFAULT_LOCALE;
|
const validLocale = isValidLocale(locale) ? locale : DEFAULT_LOCALE;
|
||||||
const localePrefix = validLocale === DEFAULT_LOCALE ? "" : `/${locale}`;
|
const localePrefix = `/${locale}`;
|
||||||
|
|
||||||
const languages: Record<string, string> = {};
|
const languages: Record<string, string> = {};
|
||||||
for (const loc of SUPPORTED_LOCALES) {
|
for (const loc of SUPPORTED_LOCALES) {
|
||||||
const prefix = loc === DEFAULT_LOCALE ? "" : `/${loc}`;
|
const prefix = `/${loc}`;
|
||||||
languages[loc] = `${baseUrl}${prefix}`;
|
languages[loc] = `${baseUrl}${prefix}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,8 +29,8 @@ export async function generateMetadata({ params }: { params: Promise<{ locale: s
|
|||||||
setRequestLocale(validLocale);
|
setRequestLocale(validLocale);
|
||||||
|
|
||||||
// Build canonical URL
|
// Build canonical URL
|
||||||
const localePrefix = validLocale === DEFAULT_LOCALE ? "" : `/${validLocale}`;
|
const localePrefix = `/${validLocale}`;
|
||||||
const canonicalUrl = `${baseUrl}${localePrefix || '/'}`;
|
const canonicalUrl = `${baseUrl}${localePrefix}`;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
title: metadata.home.title,
|
title: metadata.home.title,
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ export async function generateMetadata({ params }: ProductPageProps): Promise<Me
|
|||||||
const secondaryKeywords = keywords.secondary.map(replaceTemplate);
|
const secondaryKeywords = keywords.secondary.map(replaceTemplate);
|
||||||
|
|
||||||
// Build canonical URL
|
// Build canonical URL
|
||||||
const localePrefix = validLocale === DEFAULT_LOCALE ? "" : `/${validLocale}`;
|
const localePrefix = `/${validLocale}`;
|
||||||
const canonicalUrl = `${baseUrl}${localePrefix}/products/${slug}`;
|
const canonicalUrl = `${baseUrl}${localePrefix}/products/${slug}`;
|
||||||
|
|
||||||
// Get product image for OpenGraph
|
// Get product image for OpenGraph
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export async function generateMetadata({ params }: ProductsPageProps): Promise<M
|
|||||||
const keywords = getPageKeywords(validLocale as Locale, 'products');
|
const keywords = getPageKeywords(validLocale as Locale, 'products');
|
||||||
|
|
||||||
// Build canonical URL
|
// Build canonical URL
|
||||||
const localePrefix = validLocale === DEFAULT_LOCALE ? "" : `/${validLocale}`;
|
const localePrefix = `/${validLocale}`;
|
||||||
const canonicalUrl = `${baseUrl}${localePrefix}/products`;
|
const canonicalUrl = `${baseUrl}${localePrefix}/products`;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user