fix: draft bug #1244

This commit is contained in:
Seohyun Kim 2024-06-30 19:33:11 +09:00
parent 3faf2ff6f5
commit f0b36068c1
4 changed files with 17 additions and 1 deletions

5
content/index.md Normal file
View File

@ -0,0 +1,5 @@
---
draft: false
---
this is index.md
go to

4
content/test.md Normal file
View File

@ -0,0 +1,4 @@
---
draft: true
---
this is index.md

6
content/test2.md Normal file
View File

@ -0,0 +1,6 @@
---
draft: false
---
this is test2.md
go to [[index]]

View File

@ -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
},
})