Jacky Zhao
2023-06-04 1406ee0f05dc688e1b7635d3ce14e63d1c42a973
1
2
3
4
5
6
7
8
9
10
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
  }
}