mirror of
https://github.com/jackyzha0/quartz.git
synced 2026-03-24 23:15:46 -05:00
fix: draft bug #1244
This commit is contained in:
parent
3faf2ff6f5
commit
f0b36068c1
5
content/index.md
Normal file
5
content/index.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
draft: false
|
||||
---
|
||||
this is index.md
|
||||
go to
|
||||
4
content/test.md
Normal file
4
content/test.md
Normal file
@ -0,0 +1,4 @@
|
||||
---
|
||||
draft: true
|
||||
---
|
||||
this is index.md
|
||||
6
content/test2.md
Normal file
6
content/test2.md
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
draft: false
|
||||
---
|
||||
this is test2.md
|
||||
|
||||
go to [[index]]
|
||||
@ -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
|
||||
},
|
||||
})
|
||||
|
||||
Loading…
Reference in New Issue
Block a user