This commit is contained in:
@@ -1,11 +1,29 @@
|
||||
import { getTranslations } from "next-intl/server";
|
||||
import MatchDetailContent from "@/components/matches/match-detail-content";
|
||||
|
||||
export async function generateMetadata() {
|
||||
const t = await getTranslations();
|
||||
import { Metadata } from "next";
|
||||
|
||||
export async function generateMetadata(props: { params: Promise<{ locale: string }> }): Promise<Metadata> {
|
||||
const params = await props.params;
|
||||
const { locale } = params;
|
||||
const t = await getTranslations({ locale, namespace: "seo" });
|
||||
const siteUrl = process.env.NEXT_PUBLIC_APP_URL || "https://iddaai.com";
|
||||
|
||||
// Next.js parses route variables automatically, but for canonical we'll just use a clean relative base if available,
|
||||
// or let next.js construct it implicitly from metadataBase if not explicitly specified.
|
||||
// We'll set alternates just for languages based on current path segment as a best effort
|
||||
const pathSegment = "matches/[id]";
|
||||
|
||||
return {
|
||||
title: `${t("matches.match-details")} | Suggest Bet`,
|
||||
title: t("matches.title"),
|
||||
description: t("matches.description"),
|
||||
alternates: {
|
||||
canonical: `${siteUrl}/${locale}/${pathSegment}`,
|
||||
languages: {
|
||||
en: `${siteUrl}/en/${pathSegment}`,
|
||||
tr: `${siteUrl}/tr/${pathSegment}`,
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user