Skip to content

Commit f3bdc54

Browse files
committed
use getMetadata in home page for improved SEO
1 parent 0fe0020 commit f3bdc54

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

app/[locale]/page.tsx

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { dataLoader } from "@/lib/utils/data/dataLoader"
1313
import { isValidDate } from "@/lib/utils/date"
1414
import { existsNamespace } from "@/lib/utils/existsNamespace"
1515
import { getLastDeployDate } from "@/lib/utils/getLastDeployDate"
16+
import { getMetadata } from "@/lib/utils/metadata"
1617
import { polishRSSList } from "@/lib/utils/rss"
1718
import { getLocaleTimestamp } from "@/lib/utils/time"
1819
import { getRequiredNamespacesForPage } from "@/lib/utils/translations"
@@ -127,13 +128,21 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => {
127128
)
128129
}
129130

130-
export async function generateMetadata() {
131-
const t = await getTranslations()
131+
export async function generateMetadata({
132+
params,
133+
}: {
134+
params: Promise<{ locale: string }>
135+
}) {
136+
const { locale } = await params
137+
138+
const t = await getTranslations({ locale })
132139

133-
return {
140+
return await getMetadata({
141+
locale,
142+
slug: [""],
134143
title: t("page-index.page-index-meta-title"),
135144
description: t("page-index.page-index-meta-description"),
136-
}
145+
})
137146
}
138147

139148
export default Page

0 commit comments

Comments
 (0)