From a674a6e567bd5b77cd74402d6412958e93336fdd Mon Sep 17 00:00:00 2001 From: bfahrenfort Date: Wed, 14 Feb 2024 13:47:09 -0600 Subject: [PATCH] fix: map vs filter --- quartz/plugins/emitters/contentIndex.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/quartz/plugins/emitters/contentIndex.ts b/quartz/plugins/emitters/contentIndex.ts index f17834009..03e95c52e 100644 --- a/quartz/plugins/emitters/contentIndex.ts +++ b/quartz/plugins/emitters/contentIndex.ts @@ -120,12 +120,13 @@ export const ContentIndex: QuartzEmitterPlugin> = (opts) => { }, async emit(ctx, content, _resources) { // If we're missing an index file, don't bother with sitemap/RSS gen - if (!(opts?.bypassIndexCheck || "index" in content.filter(c => c[1].data.slug!))) { + if (!(opts?.bypassIndexCheck || "index" in content.map(c => c[1].data.slug!))) { console.warn(chalk.yellow(`Warning: contentIndex: content/ folder is missing an index.md. RSS feeds and sitemap will not be generated. If you still wish to generate these files, add: bypassIndexCheck: true, - to your configuration for Plugin.ContentIndex({...}) in quartz.config.ts`)) + to your configuration for Plugin.ContentIndex({...}) in quartz.config.ts. + Don't do this unless you know what you're doing!`)) return [] }