From 3636c052eb054d93a8a3ddfb9fdd873d5fe83a5d Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Wed, 31 May 2023 21:41:44 +0000
Subject: [PATCH] link processing

---
 quartz/processors/filter.ts |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/quartz/processors/filter.ts b/quartz/processors/filter.ts
index e69de29..31662bc 100644
--- a/quartz/processors/filter.ts
+++ b/quartz/processors/filter.ts
@@ -0,0 +1,16 @@
+import { PerfTimer } from "../perf"
+import { QuartzFilterPlugin } from "../plugins/types"
+import { ProcessedContent } from "../plugins/vfile"
+
+export function filterContent(plugins: QuartzFilterPlugin[], content: ProcessedContent[], verbose: boolean): ProcessedContent[] {
+  const perf = new PerfTimer()
+  const initialLength = content.length
+  for (const plugin of plugins) {
+    content = content.filter(plugin.shouldPublish)
+  }
+
+  if (verbose) {
+    console.log(`Filtered out ${initialLength - content.length} files in ${perf.timeSince()}`)
+  }
+  return content
+}

--
Gitblit v1.10.0