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/aliases.ts |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/quartz/plugins/emitters/aliases.ts b/quartz/plugins/emitters/aliases.ts
index 9d12a99..a16093b 100644
--- a/quartz/plugins/emitters/aliases.ts
+++ b/quartz/plugins/emitters/aliases.ts
@@ -18,15 +18,13 @@
 
     return graph
   },
-  async emit(ctx, content, _resources): Promise<FilePath[]> {
-    const fps: FilePath[] = []
-
+  async *emit(ctx, content, _resources) {
     for (const [_tree, file] of content) {
       const ogSlug = simplifySlug(file.data.slug!)
 
       for (const slug of file.data.aliases ?? []) {
         const redirUrl = resolveRelative(slug, file.data.slug!)
-        const fp = await write({
+        yield write({
           ctx,
           content: `
             <!DOCTYPE html>
@@ -43,10 +41,7 @@
           slug,
           ext: ".html",
         })
-
-        fps.push(fp)
       }
     }
-    return fps
   },
 })

--
Gitblit v1.10.0