plugin integration round 2

This commit is contained in:
Jacky Zhao
2023-05-30 08:02:20 -07:00
parent 70a05fccd5
commit 62d0c4bd1a
29 changed files with 3863 additions and 100 deletions

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'