fix: generalize frontmatter parsing and coercing
This commit is contained in:
@ -3,11 +3,6 @@ import { QuartzFilterPlugin } from "../types"
|
||||
export const ExplicitPublish: QuartzFilterPlugin = () => ({
|
||||
name: "ExplicitPublish",
|
||||
shouldPublish(_ctx, [_tree, vfile]) {
|
||||
const publishProperty = vfile.data?.frontmatter?.publish ?? false
|
||||
const publishFlag =
|
||||
typeof publishProperty === "string"
|
||||
? publishProperty.toLowerCase() === "true"
|
||||
: Boolean(publishProperty)
|
||||
return publishFlag
|
||||
return vfile.data?.frontmatter?.publish ?? false
|
||||
},
|
||||
})
|
||||
|
Reference in New Issue
Block a user