lint: format

This commit is contained in:
bfahrenfort 2024-02-14 13:50:14 -06:00
parent a674a6e567
commit edc51f75ab

View File

@ -120,13 +120,15 @@ export const ContentIndex: QuartzEmitterPlugin<Partial<Options>> = (opts) => {
}, },
async emit(ctx, content, _resources) { async emit(ctx, content, _resources) {
// If we're missing an index file, don't bother with sitemap/RSS gen // If we're missing an index file, don't bother with sitemap/RSS gen
if (!(opts?.bypassIndexCheck || "index" in content.map(c => c[1].data.slug!))) { if (!(opts?.bypassIndexCheck || "index" in content.map((c) => c[1].data.slug!))) {
console.warn(chalk.yellow(`Warning: contentIndex: console.warn(
chalk.yellow(`Warning: contentIndex:
content/ folder is missing an index.md. RSS feeds and sitemap will not be generated. content/ folder is missing an index.md. RSS feeds and sitemap will not be generated.
If you still wish to generate these files, add: If you still wish to generate these files, add:
bypassIndexCheck: true, 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!`)) Don't do this unless you know what you're doing!`),
)
return [] return []
} }
@ -176,13 +178,15 @@ export const ContentIndex: QuartzEmitterPlugin<Partial<Options>> = (opts) => {
if (opts?.enableRSS) { if (opts?.enableRSS) {
opts.feedDirectories!.map((feed) => { opts.feedDirectories!.map((feed) => {
emitted.push(write({ emitted.push(
ctx, write({
// bfahrenfort: we just generated a feedIndices entry for every directories entry, guaranteed non-null ctx,
content: generateRSSFeed(cfg, feedIndices.get(feed)!, opts?.rssLimit), // bfahrenfort: we just generated a feedIndices entry for every directories entry, guaranteed non-null
slug: feed as FullSlug, content: generateRSSFeed(cfg, feedIndices.get(feed)!, opts?.rssLimit),
ext: ".xml", slug: feed as FullSlug,
})) ext: ".xml",
}),
)
}) })
} }