Skip to content

Commit

Permalink
Update createSitemap.ts
Browse files Browse the repository at this point in the history
When `trailingSlash` option is enabled, routes that already end in a `/` are shown with double slash at the end.
  • Loading branch information
ntbosscher authored Jan 6, 2021
1 parent 89a2ba7 commit 5edfc43
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/docusaurus-plugin-sitemap/src/createSitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default function createSitemap(
.filter((route) => !route.endsWith('404.html'))
.map(
(routesPath): SitemapItemOptions => ({
url: `${routesPath}${trailingSlash && routesPath !== '/' ? '/' : ''}`,
url: `${routesPath}${trailingSlash && !routesPath.endsWith('/') ? '/' : ''}`,
changefreq,
priority,
}),
Expand Down

0 comments on commit 5edfc43

Please sign in to comment.