Jacky Zhao
2024-10-15 b3a02909ba74fff08cd3675707d1f4d782a24e98
fix: make filter checks more strict (closes #1519)
2 files modified
4 ■■■■ changed files
quartz/plugins/filters/draft.ts 2 ●●● patch | view | raw | blame | history
quartz/plugins/filters/explicit.ts 2 ●●● patch | view | raw | blame | history
quartz/plugins/filters/draft.ts
@@ -3,7 +3,7 @@
export const RemoveDrafts: QuartzFilterPlugin<{}> = () => ({
  name: "RemoveDrafts",
  shouldPublish(_ctx, [_tree, vfile]) {
    const draftFlag: boolean = vfile.data?.frontmatter?.draft || false
    const draftFlag: boolean = vfile.data?.frontmatter?.draft === true
    return !draftFlag
  },
})
quartz/plugins/filters/explicit.ts
@@ -3,6 +3,6 @@
export const ExplicitPublish: QuartzFilterPlugin = () => ({
  name: "ExplicitPublish",
  shouldPublish(_ctx, [_tree, vfile]) {
    return vfile.data?.frontmatter?.publish ?? false
    return vfile.data?.frontmatter?.publish === true
  },
})