Skip to content

Commit

Permalink
fix: fix sitemap path resolution
Browse files Browse the repository at this point in the history
closes #2749
  • Loading branch information
brc-dd committed Aug 8, 2023
1 parent 20b509c commit 481a5e3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/node/build/generateSitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ export async function generateSitemap(siteConfig: SiteConfig) {
const getLastmod = async (url: string) => {
if (!siteConfig.lastUpdated) return undefined

let path = url.replace(/(^|\/)$/, '$1index')
path = path.replace(/(\.html)?$/, '.md')
path = siteConfig.rewrites.inv[path] || path
let file = url.replace(/(^|\/)$/, '$1index')
file = file.replace(/(\.html)?$/, '.md')
file = siteConfig.rewrites.inv[file] || file
file = path.join(siteConfig.srcDir, file)

return (await getGitTimestamp(path)) || undefined
return (await getGitTimestamp(file)) || undefined
}

await task('generating sitemap', async () => {
Expand Down

0 comments on commit 481a5e3

Please sign in to comment.