fix: modified time data of frontmatter didnt loaded. (#2165)
Some checks failed
Build and Test / build-and-test (windows-latest) (push) Has been cancelled
Build and Test / build-and-test (macos-latest) (push) Has been cancelled
Build and Test / build-and-test (ubuntu-latest) (push) Has been cancelled
Build and Test / publish-tag (push) Has been cancelled
Docker build & push image / build (push) Has been cancelled

This commit is contained in:
FishCat233 2025-10-17 00:10:25 +08:00 committed by GitHub
parent b4805a1031
commit 52460f376f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -103,7 +103,6 @@ export const FrontMatter: QuartzTransformerPlugin<Partial<Options>> = (userOpts)
const created = coalesceAliases(data, ["created", "date"])
if (created) {
data.created = created
data.modified ||= created // if modified is not set, use created
}
const modified = coalesceAliases(data, [
@ -113,6 +112,8 @@ export const FrontMatter: QuartzTransformerPlugin<Partial<Options>> = (userOpts)
"last-modified",
])
if (modified) data.modified = modified
data.modified ||= created // if modified is not set, use created
const published = coalesceAliases(data, ["published", "publishDate", "date"])
if (published) data.published = published