diff --git a/quartz/plugins/filters/draft.ts b/quartz/plugins/filters/draft.ts index 09a3c3a..e8f1d4e 100644 --- a/quartz/plugins/filters/draft.ts +++ b/quartz/plugins/filters/draft.ts @@ -3,7 +3,8 @@ import { QuartzFilterPlugin } from "../types" export const RemoveDrafts: QuartzFilterPlugin<{}> = () => ({ name: "RemoveDrafts", shouldPublish(_ctx, [_tree, vfile]) { - const draftFlag: boolean = vfile.data?.frontmatter?.draft === true + const draftFlag: boolean = + vfile.data?.frontmatter?.draft === true || vfile.data?.frontmatter?.draft === "true" return !draftFlag }, }) diff --git a/quartz/plugins/filters/explicit.ts b/quartz/plugins/filters/explicit.ts index 603b46d..e2558e8 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 === true + return vfile.data?.frontmatter?.publish === true || vfile.data?.frontmatter?.publish === "true" }, }) diff --git a/quartz/plugins/transformers/frontmatter.ts b/quartz/plugins/transformers/frontmatter.ts index 70a60d8..2e599aa 100644 --- a/quartz/plugins/transformers/frontmatter.ts +++ b/quartz/plugins/transformers/frontmatter.ts @@ -88,8 +88,8 @@ declare module "vfile" { tags: string[] aliases: string[] description: string - publish: boolean - draft: boolean + publish: boolean | string + draft: boolean | string lang: string enableToc: string cssclasses: string[]