Skip to content

Commit e879913

Browse files
committedAug 30, 2024·
fix(i18n): broken trailing slashes config when using differentDomains
Fixes #349
1 parent 7dbba97 commit e879913

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
 

Diff for: ‎src/runtime/nitro/sitemap/builder/sitemap.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ export async function buildSitemapUrls(sitemap: SitemapDefinition, resolvers: Ni
214214
absolute: true,
215215
withBase: false,
216216
siteUrl: withHttps(domain),
217-
trailingSlash: !_tester('/test/').endsWith('/'),
217+
trailingSlash: _tester('/test/').endsWith('/'),
218218
base: '/',
219219
})
220220
}

Diff for: ‎test/integration/i18n/domains.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ describe('i18n domains', () => {
5757
"<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="/__sitemap__/style.xsl"?>
5858
<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">
5959
<url>
60-
<loc>https://fr.nuxtseo.com/fr/</loc>
60+
<loc>https://fr.nuxtseo.com/fr</loc>
6161
<xhtml:link rel="alternate" hreflang="en-US" href="https://nuxtseo.com/en" />
6262
<xhtml:link rel="alternate" hreflang="es-ES" href="https://es.nuxtseo.com/es" />
6363
<xhtml:link rel="alternate" hreflang="fr-FR" href="https://fr.nuxtseo.com/fr" />
6464
<xhtml:link rel="alternate" hreflang="x-default" href="https://nuxtseo.com/en" />
6565
</url>
6666
<url>
67-
<loc>https://fr.nuxtseo.com/fr/test/</loc>
67+
<loc>https://fr.nuxtseo.com/fr/test</loc>
6868
<xhtml:link rel="alternate" hreflang="en-US" href="https://nuxtseo.com/en/test" />
6969
<xhtml:link rel="alternate" hreflang="es-ES" href="https://es.nuxtseo.com/es/test" />
7070
<xhtml:link rel="alternate" hreflang="fr-FR" href="https://fr.nuxtseo.com/fr/test" />

0 commit comments

Comments
 (0)
Please sign in to comment.