From 9c8fec06d2b58e4e3bbe280ddc665a99fcc4878c Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Sun, 09 Mar 2025 22:33:15 +0000
Subject: [PATCH] feat: support non-singleton search
---
quartz/processors/filter.ts | 13 +++++--------
1 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/quartz/processors/filter.ts b/quartz/processors/filter.ts
index 12c5b48..b269fb3 100644
--- a/quartz/processors/filter.ts
+++ b/quartz/processors/filter.ts
@@ -1,16 +1,13 @@
-import { BuildCtx } from "../ctx"
-import { PerfTimer } from "../perf"
-import { QuartzFilterPluginInstance } from "../plugins/types"
+import { BuildCtx } from "../util/ctx"
+import { PerfTimer } from "../util/perf"
import { ProcessedContent } from "../plugins/vfile"
-export function filterContent(
- { cfg, argv }: BuildCtx,
- content: ProcessedContent[],
-): ProcessedContent[] {
+export function filterContent(ctx: BuildCtx, content: ProcessedContent[]): ProcessedContent[] {
+ const { cfg, argv } = ctx
const perf = new PerfTimer()
const initialLength = content.length
for (const plugin of cfg.plugins.filters) {
- const updatedContent = content.filter(plugin.shouldPublish)
+ const updatedContent = content.filter((item) => plugin.shouldPublish(ctx, item))
if (argv.verbose) {
const diff = content.filter((x) => !updatedContent.includes(x))
--
Gitblit v1.10.0