Was trying to figure out why all of the dates in my Quartz installation were set to the current date. My configuration looked like this:
import { QuartzConfig } from "./quartz/cfg"
import * as Plugin from "./quartz/plugins"
const config: QuartzConfig = {
: {
configuration: "published",
defaultDateType/* elided */
,
}: {
plugins: [
transformersPlugin.CreatedModifiedDate({
: ["frontmatter", "filesystem"],
priority,
})/* elided */
,
]/* elided */
,
}
}
export default config
According to the Quartz documentation:
Syntax, Authoring Content, Quartz Documentation
Some common frontmatter fields that are natively supported by Quartz: [...]
date
: A string representing the day the note was published. Normally usesYYYY-MM-DD
format.
So, I updated my files accordingly:
---
title: why i make games
date: 2024-03-18
aliases:
- why i make games
---
However, this did not fix the dates. Upon
inspection of the
source code, it appears that the default
CreatedModifiedDate
plugin
does not read the
date
field to set the published
date:
||= file.data.frontmatter.date as MaybeDate
created ||= file.data.frontmatter.lastmod as MaybeDate
modified ||= file.data.frontmatter.updated as MaybeDate
modified ||= file.data.frontmatter["last-modified"] as MaybeDate
modified ||= file.data.frontmatter.publishDate as MaybeDate published
Changing the frontmatter to this fixed the date issue:
---
title: why i make games
publishDate: 2024-03-18
aliases:
- why i make games
---