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: {
defaultDateType: "published",
/* elided */
},
plugins: {
transformers: [
Plugin.CreatedModifiedDate({
priority: ["frontmatter", "filesystem"],
}),
/* elided */
],
/* elided */
},
}
export default configAccording 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-DDformat.
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:
created ||= file.data.frontmatter.date as MaybeDate
modified ||= file.data.frontmatter.lastmod as MaybeDate
modified ||= file.data.frontmatter.updated as MaybeDate
modified ||= file.data.frontmatter["last-modified"] as MaybeDate
published ||= file.data.frontmatter.publishDate as MaybeDateChanging the frontmatter to this fixed the date issue:
---
title: why i make games
publishDate: 2024-03-18
aliases:
- why i make games
---