From 21c007e2fcf73fe4ef04dd07db7116afed46047a Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Wed, 31 May 2023 21:01:23 +0000
Subject: [PATCH] rendering, link resolution, asset copying
---
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