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

11 lines
330 B
TypeScript
Raw Normal View History

2023-05-30 15:02:20 +00:00
import { QuartzFilterPlugin } from "../types"
import { ProcessedContent } from "../vfile"
export class RemoveDrafts extends QuartzFilterPlugin {
name = "RemoveDrafts"
shouldPublish([_tree, vfile]: ProcessedContent): boolean {
const draftFlag: boolean = vfile.data?.frontmatter?.draft ?? false
return !draftFlag
}
}