From f0b36068c175338bf44fad86e5968c5a74512a8f Mon Sep 17 00:00:00 2001 From: Seohyun Kim <153896425+1etterh@users.noreply.github.com> Date: Sun, 30 Jun 2024 19:33:11 +0900 Subject: [PATCH] fix: draft bug #1244 --- content/index.md | 5 +++++ content/test.md | 4 ++++ content/test2.md | 6 ++++++ quartz/plugins/filters/draft.ts | 3 ++- 4 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 content/index.md create mode 100644 content/test.md create mode 100644 content/test2.md diff --git a/content/index.md b/content/index.md new file mode 100644 index 000000000..cc2e2028e --- /dev/null +++ b/content/index.md @@ -0,0 +1,5 @@ +--- +draft: false +--- +this is index.md +go to \ No newline at end of file diff --git a/content/test.md b/content/test.md new file mode 100644 index 000000000..caf71f7d6 --- /dev/null +++ b/content/test.md @@ -0,0 +1,4 @@ +--- +draft: true +--- +this is index.md diff --git a/content/test2.md b/content/test2.md new file mode 100644 index 000000000..8e050f6e5 --- /dev/null +++ b/content/test2.md @@ -0,0 +1,6 @@ +--- +draft: false +--- +this is test2.md + +go to [[index]] \ No newline at end of file diff --git a/quartz/plugins/filters/draft.ts b/quartz/plugins/filters/draft.ts index 65e2d6b61..d2f25a595 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 ?? false + const draftFlag: boolean = vfile.data?.frontmatter?.draft || false + console.log(`######${draftFlag}`); return !draftFlag }, })