From 3ea901334d6947ad32403d5348e946b0a6ee8509 Mon Sep 17 00:00:00 2001 From: bfahrenfort Date: Sun, 24 Aug 2025 09:59:58 +0200 Subject: [PATCH] fix(contentIndex): restore empty file choice --- quartz/plugins/emitters/contentIndex.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/quartz/plugins/emitters/contentIndex.tsx b/quartz/plugins/emitters/contentIndex.tsx index e29d860b8..cd2741212 100644 --- a/quartz/plugins/emitters/contentIndex.tsx +++ b/quartz/plugins/emitters/contentIndex.tsx @@ -164,6 +164,11 @@ export const ContentIndex: QuartzEmitterPlugin> = (opts) => { var pointer = indexTree const dirs = file.data.relativePath?.split("/").slice(0, -1) ?? [] + // If file is blank, don't include it unless specified + if (!opts?.includeEmptyFiles || (file.data.text && file.data.text === "")) { + continue + } + // Skips descent if file is top-level (ex. content/index.md) for (var i = 1; i <= dirs.length; i++) { // Initialize directories