From c5cc07159060c616838b4a1d16777fd25218feea Mon Sep 17 00:00:00 2001 From: Dralagen Date: Thu, 13 Mar 2025 23:03:46 +0100 Subject: [PATCH] fix(transformer): use path.relative for improved path handling in last modified date calculation --- quartz/plugins/transformers/lastmod.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/quartz/plugins/transformers/lastmod.ts b/quartz/plugins/transformers/lastmod.ts index c561ff488..02278037d 100644 --- a/quartz/plugins/transformers/lastmod.ts +++ b/quartz/plugins/transformers/lastmod.ts @@ -58,8 +58,7 @@ export const CreatedModifiedDate: QuartzTransformerPlugin> = (u // or 1+ level higher in case of a submodule/subtree setup repo = Repository.discover(fullFp) } - - var relativePath = fullFp.replace(repo.workdir()!, "") + const relativePath = path.relative(repo.workdir()!, fullFp) try { modified ||= await repo.getFileLatestModifiedDateAsync(relativePath)