From b44a79eebaf1664512ef5ff4e3246b3a6a416ff4 Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Tue, 19 Dec 2023 19:40:59 +0000
Subject: [PATCH] fix: wikilinks should allow external links (closes #639)

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

diff --git a/quartz/processors/filter.ts b/quartz/processors/filter.ts
index e69de29..b269fb3 100644
--- a/quartz/processors/filter.ts
+++ b/quartz/processors/filter.ts
@@ -0,0 +1,24 @@
+import { BuildCtx } from "../util/ctx"
+import { PerfTimer } from "../util/perf"
+import { ProcessedContent } from "../plugins/vfile"
+
+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((item) => plugin.shouldPublish(ctx, item))
+
+    if (argv.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