mirror of
https://github.com/alrayyes/wiki.git
synced 2025-05-01 14:38:14 +00:00
fix: generalize frontmatter parsing and coercing
This commit is contained in:
parent
b211d49922
commit
42ee069c1c
5 changed files with 90 additions and 70 deletions
quartz/plugins/filters
|
@ -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
|
||||
},
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue