Skip to content

Commit

Permalink
fix: frontmatter coercion (empty string is falsy)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackyzha0 committed Dec 9, 2023
1 parent a7e2080 commit 2c69b0c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions quartz/plugins/transformers/frontmatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ export const FrontMatter: QuartzTransformerPlugin<Partial<Options> | undefined>
})

// tag is an alias for tags
if (data.tag) {
data.tags = data.tag
if (data.tag !== null) {
data.tags = data.tag.toString()
}

// coerce title to string
if (data.title) {
if (data.title !== null) {
data.title = data.title.toString()
}

if (data.tags && !Array.isArray(data.tags)) {
if (data.tags !== null && !Array.isArray(data.tags)) {
data.tags = data.tags
.toString()
.split(oneLineTagDelim)
Expand Down

0 comments on commit 2c69b0c

Please sign in to comment.