File tree Expand file tree Collapse file tree 2 files changed +19
-10
lines changed Expand file tree Collapse file tree 2 files changed +19
-10
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import { dataLoader } from "@/lib/utils/data/dataLoader"
13
13
import { isValidDate } from "@/lib/utils/date"
14
14
import { existsNamespace } from "@/lib/utils/existsNamespace"
15
15
import { getLastDeployDate } from "@/lib/utils/getLastDeployDate"
16
+ import { getMetadata } from "@/lib/utils/metadata"
16
17
import { polishRSSList } from "@/lib/utils/rss"
17
18
import { getLocaleTimestamp } from "@/lib/utils/time"
18
19
import { getRequiredNamespacesForPage } from "@/lib/utils/translations"
@@ -127,13 +128,21 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => {
127
128
)
128
129
}
129
130
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
132
137
133
- return {
134
- title : t ( "page-index.page-index-meta-title" ) ,
135
- description : t ( "page-index.page-index-meta-description" ) ,
136
- }
138
+ const t = await getTranslations ( { locale, namespace : "page-index" } )
139
+
140
+ return await getMetadata ( {
141
+ locale,
142
+ slug : [ "" ] ,
143
+ title : t ( "page-index-meta-title" ) ,
144
+ description : t ( "page-index-meta-description" ) ,
145
+ } )
137
146
}
138
147
139
148
export default Page
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { getTranslations } from "next-intl/server"
3
3
4
4
import { DEFAULT_OG_IMAGE , SITE_URL } from "@/lib/constants"
5
5
6
+ import { isLocaleValidISO639_1 } from "./translations"
6
7
import { getFullUrl } from "./url"
7
8
8
9
import { routing } from "@/i18n/routing"
@@ -71,10 +72,9 @@ export const getMetadata = async ({
71
72
languages : {
72
73
"x-default" : xDefault ,
73
74
...Object . fromEntries (
74
- routing . locales . map ( ( locale ) => [
75
- locale ,
76
- getFullUrl ( locale , slugString ) ,
77
- ] )
75
+ routing . locales
76
+ . filter ( isLocaleValidISO639_1 )
77
+ . map ( ( locale ) => [ locale , getFullUrl ( locale , slugString ) ] )
78
78
) ,
79
79
} ,
80
80
} ,
You can’t perform that action at this time.
0 commit comments