plugin integration round 2
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"
|
||||
import { ProcessedContent } from "../vfile"
|
||||
|
||||
export class RemoveDrafts extends QuartzFilterPlugin {
|
||||
name = "RemoveDrafts"
|
||||
shouldPublish([_tree, vfile]: ProcessedContent): boolean {
|
||||
const draftFlag: boolean = vfile.data?.frontmatter?.draft ?? false
|
||||
return !draftFlag
|
||||
}
|
||||
}
|
10
quartz/plugins/filters/explicit.ts
Normal file
10
quartz/plugins/filters/explicit.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import { QuartzFilterPlugin } from "../types"
|
||||
import { ProcessedContent } from "../vfile"
|
||||
|
||||
export class ExplicitPublish extends QuartzFilterPlugin {
|
||||
name = "ExplicitPublish"
|
||||
shouldPublish([_tree, vfile]: ProcessedContent): boolean {
|
||||
const publishFlag: boolean = vfile.data?.frontmatter?.publish ?? false
|
||||
return publishFlag
|
||||
}
|
||||
}
|
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