diff --git a/quartz/plugins/transformers/lastmod.ts b/quartz/plugins/transformers/lastmod.ts index fd5769263..c561ff488 100644 --- a/quartz/plugins/transformers/lastmod.ts +++ b/quartz/plugins/transformers/lastmod.ts @@ -56,11 +56,13 @@ export const CreatedModifiedDate: QuartzTransformerPlugin> = (u // Get a reference to the main git repo. // It's either the same as the workdir, // or 1+ level higher in case of a submodule/subtree setup - repo = Repository.discover(file.cwd) + repo = Repository.discover(fullFp) } + var relativePath = fullFp.replace(repo.workdir()!, "") + try { - modified ||= await repo.getFileLatestModifiedDateAsync(file.data.filePath!) + modified ||= await repo.getFileLatestModifiedDateAsync(relativePath) } catch { console.log( chalk.yellow(