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/folderPage.tsx |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/quartz/plugins/emitters/folderPage.tsx b/quartz/plugins/emitters/folderPage.tsx
index bafaec9..1c81207 100644
--- a/quartz/plugins/emitters/folderPage.tsx
+++ b/quartz/plugins/emitters/folderPage.tsx
@@ -69,8 +69,7 @@
 
       return graph
     },
-    async emit(ctx, content, resources): Promise<FilePath[]> {
-      const fps: FilePath[] = []
+    async *emit(ctx, content, resources) {
       const allFiles = content.map((c) => c[1].data)
       const cfg = ctx.cfg.configuration
 
@@ -119,16 +118,13 @@
         }
 
         const content = renderPage(cfg, slug, componentData, opts, externalResources)
-        const fp = await write({
+        yield write({
           ctx,
           content,
           slug,
           ext: ".html",
         })
-
-        fps.push(fp)
       }
-      return fps
     },
   }
 }

--
Gitblit v1.10.0