mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-22 11:36:23 +00:00
fix: frontmatter coercion (empty string is falsy)
This commit is contained in:
parent
a7e20804f5
commit
2c69b0c97d
1 changed files with 4 additions and 4 deletions
|
@ -37,16 +37,16 @@ export const FrontMatter: QuartzTransformerPlugin<Partial<Options> | undefined>
|
||||||
})
|
})
|
||||||
|
|
||||||
// tag is an alias for tags
|
// tag is an alias for tags
|
||||||
if (data.tag) {
|
if (data.tag !== null) {
|
||||||
data.tags = data.tag
|
data.tags = data.tag.toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
// coerce title to string
|
// coerce title to string
|
||||||
if (data.title) {
|
if (data.title !== null) {
|
||||||
data.title = data.title.toString()
|
data.title = data.title.toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.tags && !Array.isArray(data.tags)) {
|
if (data.tags !== null && !Array.isArray(data.tags)) {
|
||||||
data.tags = data.tags
|
data.tags = data.tags
|
||||||
.toString()
|
.toString()
|
||||||
.split(oneLineTagDelim)
|
.split(oneLineTagDelim)
|
||||||
|
|
Loading…
Reference in a new issue