fix: correctly parse falsy js as title (#900)

This commit is contained in:
Eiko Wagenknecht 2024-02-19 22:49:07 +01:00 committed by GitHub
parent 779c501d9e
commit b6cf3df84f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -57,9 +57,9 @@ export const FrontMatter: QuartzTransformerPlugin<Partial<Options> | undefined>
},
})
if (data.title) {
if (data.title != null && data.title.toString() !== "") {
data.title = data.title.toString()
} else if (data.title === null || data.title === undefined) {
} else {
data.title = file.stem ?? i18n(cfg.configuration.locale).propertyDefaults.title
}