quartz-research-note/quartz/plugins/filters/explicit.ts

10 lines
280 B
TypeScript
Raw Normal View History

2023-05-30 15:02:20 +00:00
import { QuartzFilterPlugin } from "../types"
export const ExplicitPublish: QuartzFilterPlugin = () => ({
name: "ExplicitPublish",
2023-07-24 07:04:01 +00:00
shouldPublish(_ctx, [_tree, vfile]) {
2023-05-30 15:02:20 +00:00
const publishFlag: boolean = vfile.data?.frontmatter?.publish ?? false
return publishFlag
2023-07-23 00:27:41 +00:00
},
})