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/404.tsx | 16 +++++++---------
1 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/quartz/plugins/emitters/404.tsx b/quartz/plugins/emitters/404.tsx
index 2d518b6..90c9d58 100644
--- a/quartz/plugins/emitters/404.tsx
+++ b/quartz/plugins/emitters/404.tsx
@@ -31,7 +31,7 @@
async getDependencyGraph(_ctx, _content, _resources) {
return new DepGraph<FilePath>()
},
- async emit(ctx, _content, resources): Promise<FilePath[]> {
+ async *emit(ctx, _content, resources) {
const cfg = ctx.cfg.configuration
const slug = "404" as FullSlug
@@ -55,14 +55,12 @@
allFiles: [],
}
- return [
- await write({
- ctx,
- content: renderPage(cfg, slug, componentData, opts, externalResources),
- slug,
- ext: ".html",
- }),
- ]
+ yield write({
+ ctx,
+ content: renderPage(cfg, slug, componentData, opts, externalResources),
+ slug,
+ ext: ".html",
+ })
},
}
}
--
Gitblit v1.10.0