toc
Jacky Zhao
2023-06-10 b8c011410d6bcd6837f4efd6a3948196a0f7aeea
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
  }
}