plugin integration round 2

This commit is contained in:
Jacky Zhao 2023-05-30 08:02:20 -07:00
parent a757521313
commit ad6ce0d73f
29 changed files with 3863 additions and 100 deletions
quartz/plugins/filters

View 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
}
}

View 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
}
}

View file

@ -0,0 +1,2 @@
export { RemoveDrafts } from './draft'
export { ExplicitPublish } from './explicit'