From b3a02909ba74fff08cd3675707d1f4d782a24e98 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Tue, 15 Oct 2024 09:34:46 -0700 Subject: [PATCH] fix: make filter checks more strict (closes #1519) --- quartz/plugins/filters/draft.ts | 2 +- quartz/plugins/filters/explicit.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/quartz/plugins/filters/draft.ts b/quartz/plugins/filters/draft.ts index 5fd06b9..09a3c3a 100644 --- a/quartz/plugins/filters/draft.ts +++ b/quartz/plugins/filters/draft.ts @@ -3,7 +3,7 @@ import { QuartzFilterPlugin } from "../types" 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 }, }) diff --git a/quartz/plugins/filters/explicit.ts b/quartz/plugins/filters/explicit.ts index 79a46a8..603b46d 100644 --- a/quartz/plugins/filters/explicit.ts +++ b/quartz/plugins/filters/explicit.ts @@ -3,6 +3,6 @@ import { QuartzFilterPlugin } from "../types" export const ExplicitPublish: QuartzFilterPlugin = () => ({ name: "ExplicitPublish", shouldPublish(_ctx, [_tree, vfile]) { - return vfile.data?.frontmatter?.publish ?? false + return vfile.data?.frontmatter?.publish === true }, })