diff --git a/src/node/build/generateSitemap.ts b/src/node/build/generateSitemap.ts index f94980b3..579141bf 100644 --- a/src/node/build/generateSitemap.ts +++ b/src/node/build/generateSitemap.ts @@ -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 () => {