Skip to content

Commit

Permalink
fix: remove trailing slashes in Sitemap
Browse files Browse the repository at this point in the history
  • Loading branch information
johannschopplich committed Feb 16, 2024
1 parent fd0789b commit 4dd568a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server/routes/sitemap.xml.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { joinURL } from 'ufo'
import { joinURL, withoutTrailingSlash } from 'ufo'
import { SitemapStream, streamToPromise } from 'sitemap'
import type { KirbyApiResponse } from 'kirby-types'

Expand Down Expand Up @@ -32,11 +32,11 @@ export default defineEventHandler(async () => {

const alternateLinks = links.map((link) => ({
lang: link.lang,
url: joinURL(siteUrl, link.url),
url: withoutTrailingSlash(joinURL(siteUrl, link.url)),
}))

sitemap.write({
url,
url: withoutTrailingSlash(url),
lastmod,
links: alternateLinks,
})
Expand Down

0 comments on commit 4dd568a

Please sign in to comment.