Skip to content

Commit

Permalink
fix: fix route generation when options.basePath is not set
Browse files Browse the repository at this point in the history
  • Loading branch information
jbaubree committed May 9, 2023
1 parent 8ceade5 commit e8904c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function getRoutes(options: ResolvedOptions) {

export function getFormattedSitemap(options: ResolvedOptions, routes: string[]) {
return routes.map(route => ({
url: new URL(options.basePath ? ensurePrefix('/', options.basePath) + ensurePrefix('/', route) : ensurePrefix('/', '/route'), removeMaybeSuffix('/', options.hostname)).href,
url: new URL(options.basePath ? ensurePrefix('/', options.basePath) + ensurePrefix('/', route) : ensurePrefix('/', route), removeMaybeSuffix('/', options.hostname)).href,
changefreq: options.changefreq,
priority: options.priority,
lastmod: options.lastmod,
Expand Down

0 comments on commit e8904c5

Please sign in to comment.