mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-24 13:24:05 -06:00
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
This commit is contained in:
parent
c005fe4408
commit
88d8d89171
@ -56,11 +56,13 @@ export const CreatedModifiedDate: QuartzTransformerPlugin<Partial<Options>> = (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(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user