File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import { getOgImage } from "@/lib/utils/metadata"
6
6
import { filterRealLocales } from "@/lib/utils/translations"
7
7
import { getFullUrl } from "@/lib/utils/url"
8
8
9
- import { SITE_URL } from "@/lib/constants"
9
+ import { DEFAULT_LOCALE , SITE_URL } from "@/lib/constants"
10
10
11
11
type NameMeta = {
12
12
name : string
@@ -52,6 +52,9 @@ const PageMetadata = ({
52
52
const url = getFullUrl ( locale , path )
53
53
const canonical = canonicalUrl || url
54
54
55
+ // Set x-default URL for hreflang
56
+ const xDefault = getFullUrl ( DEFAULT_LOCALE , path )
57
+
55
58
/* Set fallback ogImage based on path */
56
59
const ogImage = image || getOgImage ( slug )
57
60
@@ -85,6 +88,7 @@ const PageMetadata = ({
85
88
/>
86
89
) ) }
87
90
< link rel = "canonical" key = { canonical } href = { canonical } />
91
+ < link rel = "alternate" hrefLang = "x-default" href = { xDefault } />
88
92
{ locales . map ( ( loc ) => (
89
93
< link
90
94
key = { loc }
You can’t perform that action at this time.
0 commit comments