Skip to content

Commit

Permalink
fix: alternative x-default should respect exclude
Browse files Browse the repository at this point in the history
Fixes #273
  • Loading branch information
harlan-zw committed Jul 1, 2024
1 parent 3d22c51 commit 262eb8e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/util/nuxtSitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export function convertNuxtPagesToSitemapEntries(pages: NuxtPage[], config: Nuxt
}
}).filter(Boolean)
const xDefault = entries.find(a => a.locale === config.defaultLocale)
if (xDefault && alternatives.length) {
if (xDefault && alternatives.length && pathFilter(xDefault.loc)) {
alternatives.push({
hreflang: 'x-default',
href: xDefault.loc,
Expand Down

0 comments on commit 262eb8e

Please sign in to comment.