Skip to content

Commit a37a7b4

Browse files
committed
fix: prevent adding multiple x-default alternate links
1 parent e8bd2d7 commit a37a7b4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/runtime/kit/head.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ function getHreflangLinks(options: HeadContext) {
134134
if (!link) continue
135135

136136
links.push(link)
137-
if (options.defaultLocale && options.defaultLocale === locale.code) {
137+
if (options.defaultLocale && options.defaultLocale === locale.code && links[0].hreflang !== 'x-default') {
138138
links.unshift(
139139
strictSeo
140140
? { rel: 'alternate', href: link.href, hreflang: 'x-default' }

0 commit comments

Comments
 (0)