Skip to content

Commit

Permalink
fix(i18n): broken trailing slashes config when using differentDomains
Browse files Browse the repository at this point in the history
Fixes #349
  • Loading branch information
harlan-zw committed Aug 30, 2024
1 parent 7dbba97 commit e879913
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/runtime/nitro/sitemap/builder/sitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ export async function buildSitemapUrls(sitemap: SitemapDefinition, resolvers: Ni
absolute: true,
withBase: false,
siteUrl: withHttps(domain),
trailingSlash: !_tester('/test/').endsWith('/'),
trailingSlash: _tester('/test/').endsWith('/'),
base: '/',
})
}
Expand Down
4 changes: 2 additions & 2 deletions test/integration/i18n/domains.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ describe('i18n domains', () => {
"<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="/__sitemap__/style.xsl"?>
<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd http://www.google.com/schemas/sitemap-image/1.1 http://www.google.com/schemas/sitemap-image/1.1/sitemap-image.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://fr.nuxtseo.com/fr/</loc>
<loc>https://fr.nuxtseo.com/fr</loc>
<xhtml:link rel="alternate" hreflang="en-US" href="https://nuxtseo.com/en" />
<xhtml:link rel="alternate" hreflang="es-ES" href="https://es.nuxtseo.com/es" />
<xhtml:link rel="alternate" hreflang="fr-FR" href="https://fr.nuxtseo.com/fr" />
<xhtml:link rel="alternate" hreflang="x-default" href="https://nuxtseo.com/en" />
</url>
<url>
<loc>https://fr.nuxtseo.com/fr/test/</loc>
<loc>https://fr.nuxtseo.com/fr/test</loc>
<xhtml:link rel="alternate" hreflang="en-US" href="https://nuxtseo.com/en/test" />
<xhtml:link rel="alternate" hreflang="es-ES" href="https://es.nuxtseo.com/es/test" />
<xhtml:link rel="alternate" hreflang="fr-FR" href="https://fr.nuxtseo.com/fr/test" />
Expand Down

0 comments on commit e879913

Please sign in to comment.