From 696403d3fa79f79fa3340bb1fe11533d1fdaf0a4 Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Thu, 13 Mar 2025 17:55:37 +0000
Subject: [PATCH] chore: bump version to 4.4.1

---
 quartz/plugins/emitters/contentIndex.tsx |   49 +++++++++++++++++++++----------------------------
 1 files changed, 21 insertions(+), 28 deletions(-)

diff --git a/quartz/plugins/emitters/contentIndex.tsx b/quartz/plugins/emitters/contentIndex.tsx
index 0cc70d8..6f43bad 100644
--- a/quartz/plugins/emitters/contentIndex.tsx
+++ b/quartz/plugins/emitters/contentIndex.tsx
@@ -12,6 +12,7 @@
 export type ContentIndexMap = Map<FullSlug, ContentDetails>
 export type ContentDetails = {
   slug: FullSlug
+  filePath: FilePath
   title: string
   links: SimpleSlug[]
   tags: string[]
@@ -116,9 +117,8 @@
 
       return graph
     },
-    async emit(ctx, content, _resources) {
+    async *emit(ctx, content, _resources) {
       const cfg = ctx.cfg.configuration
-      const emitted: FilePath[] = []
       const linkIndex: ContentIndexMap = new Map()
       for (const [tree, file] of content) {
         const slug = file.data.slug!
@@ -126,6 +126,7 @@
         if (opts?.includeEmptyFiles || (file.data.text && file.data.text !== "")) {
           linkIndex.set(slug, {
             slug,
+            filePath: file.data.filePath!,
             title: file.data.frontmatter?.title!,
             links: file.data.links ?? [],
             tags: file.data.frontmatter?.tags ?? [],
@@ -140,25 +141,21 @@
       }
 
       if (opts?.enableSiteMap) {
-        emitted.push(
-          await write({
-            ctx,
-            content: generateSiteMap(cfg, linkIndex),
-            slug: "sitemap" as FullSlug,
-            ext: ".xml",
-          }),
-        )
+        yield write({
+          ctx,
+          content: generateSiteMap(cfg, linkIndex),
+          slug: "sitemap" as FullSlug,
+          ext: ".xml",
+        })
       }
 
       if (opts?.enableRSS) {
-        emitted.push(
-          await write({
-            ctx,
-            content: generateRSSFeed(cfg, linkIndex, opts.rssLimit),
-            slug: (opts?.rssSlug ?? "index") as FullSlug,
-            ext: ".xml",
-          }),
-        )
+        yield write({
+          ctx,
+          content: generateRSSFeed(cfg, linkIndex, opts.rssLimit),
+          slug: (opts?.rssSlug ?? "index") as FullSlug,
+          ext: ".xml",
+        })
       }
 
       const fp = joinSegments("static", "contentIndex") as FullSlug
@@ -173,16 +170,12 @@
         }),
       )
 
-      emitted.push(
-        await write({
-          ctx,
-          content: JSON.stringify(simplifiedIndex),
-          slug: fp,
-          ext: ".json",
-        }),
-      )
-
-      return emitted
+      yield write({
+        ctx,
+        content: JSON.stringify(simplifiedIndex),
+        slug: fp,
+        ext: ".json",
+      })
     },
     externalResources: (ctx) => {
       if (opts?.enableRSS) {

--
Gitblit v1.10.0