|
|
|
@ -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 () => {
|
|
|
|
|