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

10 lines
273 B
TypeScript
Raw Normal View History

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