mirror of
https://github.com/alrayyes/wiki.git
synced 2025-05-01 06:28:14 +00:00
plugin integration round 2
This commit is contained in:
parent
a757521313
commit
ad6ce0d73f
29 changed files with 3863 additions and 100 deletions
quartz/plugins/filters
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'
|
Loading…
Add table
Add a link
Reference in a new issue