mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-24 13:24:05 -06:00
fix(frontmatter): set modified to created only when no other modified frontmatter exist
This commit is contained in:
parent
ebff6617bb
commit
b6e47b907a
@ -103,7 +103,6 @@ export const FrontMatter: QuartzTransformerPlugin<Partial<Options>> = (userOpts)
|
|||||||
const created = coalesceAliases(data, ["created", "date"])
|
const created = coalesceAliases(data, ["created", "date"])
|
||||||
if (created) {
|
if (created) {
|
||||||
data.created = created
|
data.created = created
|
||||||
data.modified ||= created // if modified is not set, use created
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const modified = coalesceAliases(data, [
|
const modified = coalesceAliases(data, [
|
||||||
@ -113,6 +112,7 @@ export const FrontMatter: QuartzTransformerPlugin<Partial<Options>> = (userOpts)
|
|||||||
"last-modified",
|
"last-modified",
|
||||||
])
|
])
|
||||||
if (modified) data.modified = modified
|
if (modified) data.modified = modified
|
||||||
|
else if (created) data.modified ||= created // if modified is not set, use created
|
||||||
const published = coalesceAliases(data, ["published", "publishDate", "date"])
|
const published = coalesceAliases(data, ["published", "publishDate", "date"])
|
||||||
if (published) data.published = published
|
if (published) data.published = published
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user