From d9159e0ac9bfc22e584c78bc8aa04ecd82c14eea Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Thu, 13 Mar 2025 17:27:46 +0000
Subject: [PATCH] feat: make og images an emitter to properly await image generation (#1826)

---
 quartz/plugins/emitters/contentPage.tsx |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/quartz/plugins/emitters/contentPage.tsx b/quartz/plugins/emitters/contentPage.tsx
index f59ff6b..8eb3e68 100644
--- a/quartz/plugins/emitters/contentPage.tsx
+++ b/quartz/plugins/emitters/contentPage.tsx
@@ -94,9 +94,8 @@
 
       return graph
     },
-    async emit(ctx, content, resources): Promise<FilePath[]> {
+    async *emit(ctx, content, resources) {
       const cfg = ctx.cfg.configuration
-      const fps: FilePath[] = []
       const allFiles = content.map((c) => c[1].data)
 
       let containsIndex = false
@@ -118,14 +117,12 @@
         }
 
         const content = renderPage(cfg, slug, componentData, opts, externalResources)
-        const fp = await write({
+        yield write({
           ctx,
           content,
           slug,
           ext: ".html",
         })
-
-        fps.push(fp)
       }
 
       if (!containsIndex && !ctx.argv.fastRebuild) {
@@ -135,8 +132,6 @@
           ),
         )
       }
-
-      return fps
     },
   }
 }

--
Gitblit v1.10.0