From 88d8d891717a88ee33e00ebed01cbe1086c4053b Mon Sep 17 00:00:00 2001 From: dralagen Date: Thu, 13 Mar 2025 15:17:13 +0100 Subject: [PATCH] fix(transformer): find last modified date form commit on submodule when the content folder has a submodule git, the relative path start in content folder and not root folder of quartz --- quartz/plugins/transformers/lastmod.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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(