From 76c092dcf20959bc52fcb13b28cee50cd4217e40 Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Thu, 20 Jul 2023 04:59:48 +0000
Subject: [PATCH] add custom.scss
---
quartz/processors/filter.ts | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/quartz/processors/filter.ts b/quartz/processors/filter.ts
index e69de29..04c14a6 100644
--- a/quartz/processors/filter.ts
+++ b/quartz/processors/filter.ts
@@ -0,0 +1,23 @@
+import { PerfTimer } from "../perf"
+import { QuartzFilterPluginInstance } from "../plugins/types"
+import { ProcessedContent } from "../plugins/vfile"
+
+export function filterContent(plugins: QuartzFilterPluginInstance[], content: ProcessedContent[], verbose: boolean): ProcessedContent[] {
+ const perf = new PerfTimer()
+ const initialLength = content.length
+ for (const plugin of plugins) {
+ const updatedContent = content.filter(plugin.shouldPublish)
+
+ if (verbose) {
+ const diff = content.filter(x => !updatedContent.includes(x))
+ for (const file of diff) {
+ console.log(`[filter:${plugin.name}] ${file[1].data.slug}`)
+ }
+ }
+
+ content = updatedContent
+ }
+
+ console.log(`Filtered out ${initialLength - content.length} files in ${perf.timeSince()}`)
+ return content
+}
--
Gitblit v1.10.0