Migrate filters to external plugins (remove-draft, explicit-publish)

Delete internal RemoveDrafts and ExplicitPublish filter implementations,
install them as community plugins, and update quartz.config.ts to use
ExternalPlugin.RemoveDrafts().
This commit is contained in:
saberzero1 2026-02-13 23:30:14 +01:00
parent 074951afea
commit 70ef4f9fd5
No known key found for this signature in database
5 changed files with 16 additions and 21 deletions

View File

@ -70,7 +70,7 @@ const config: QuartzConfig = {
ExternalPlugin.Description(),
ExternalPlugin.Latex({ renderEngine: "katex" }),
],
filters: [Plugin.RemoveDrafts()],
filters: [ExternalPlugin.RemoveDrafts()],
emitters: [
Plugin.AliasRedirects(),
Plugin.ComponentResources(),
@ -122,6 +122,8 @@ const config: QuartzConfig = {
"github:quartz-community/citations",
"github:quartz-community/ox-hugo",
"github:quartz-community/roam",
"github:quartz-community/remove-draft",
"github:quartz-community/explicit-publish",
],
}

View File

@ -174,6 +174,18 @@
"resolved": "https://github.com/quartz-community/roam.git",
"commit": "b6e6fab11cde1430d396822ebcefd501b486adf1",
"installedAt": "2026-02-13T22:03:27.359Z"
},
"remove-draft": {
"source": "github:quartz-community/remove-draft",
"resolved": "https://github.com/quartz-community/remove-draft.git",
"commit": "6f7fbeb4b092e7549e3e04b8de5e830f5660015d",
"installedAt": "2026-02-13T22:27:58.368Z"
},
"explicit-publish": {
"source": "github:quartz-community/explicit-publish",
"resolved": "https://github.com/quartz-community/explicit-publish.git",
"commit": "f870ac6a13d297c0f4451986c7f7042f006c3b38",
"installedAt": "2026-02-13T22:28:08.774Z"
}
}
}

View File

@ -1,10 +0,0 @@
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
},
})

View File

@ -1,8 +0,0 @@
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"
},
})

View File

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