Initial commit
This commit is contained in:
10
quartz/plugins/filters/draft.ts
Normal file
10
quartz/plugins/filters/draft.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { QuartzFilterPlugin } from "../types"
|
||||
|
||||
export const RemoveDrafts: QuartzFilterPlugin<{}> = () => ({
|
||||
name: "RemoveDrafts",
|
||||
shouldPublish(_ctx, [_tree, vfile]) {
|
||||
const draftFlag: boolean =
|
||||
vfile.data?.frontmatter?.draft === true || vfile.data?.frontmatter?.draft === "true"
|
||||
return !draftFlag
|
||||
},
|
||||
})
|
||||
8
quartz/plugins/filters/explicit.ts
Normal file
8
quartz/plugins/filters/explicit.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { QuartzFilterPlugin } from "../types"
|
||||
|
||||
export const ExplicitPublish: QuartzFilterPlugin = () => ({
|
||||
name: "ExplicitPublish",
|
||||
shouldPublish(_ctx, [_tree, vfile]) {
|
||||
return vfile.data?.frontmatter?.publish === true || vfile.data?.frontmatter?.publish === "true"
|
||||
},
|
||||
})
|
||||
2
quartz/plugins/filters/index.ts
Normal file
2
quartz/plugins/filters/index.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export { RemoveDrafts } from "./draft"
|
||||
export { ExplicitPublish } from "./explicit"
|
||||
Reference in New Issue
Block a user