Jacky Zhao
2023-11-17 6a05fa777c3830631d8aeb16bdda287a1fea3b80
quartz/plugins/filters/explicit.ts
@@ -1,10 +1,9 @@
import { QuartzFilterPlugin } from "../types"
import { ProcessedContent } from "../vfile"
export class ExplicitPublish extends QuartzFilterPlugin {
  name = "ExplicitPublish"
  shouldPublish([_tree, vfile]: ProcessedContent): boolean {
export const ExplicitPublish: QuartzFilterPlugin = () => ({
  name: "ExplicitPublish",
  shouldPublish(_ctx, [_tree, vfile]) {
    const publishFlag: boolean = vfile.data?.frontmatter?.publish ?? false
    return publishFlag
  }
}
  },
})