From feb5a5c74db2b8c1c011a41724d69b8e8f58ecc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=BE=E6=B5=A6=20=E7=9F=A5=E4=B9=9F=20Matsuura=20Tomoy?= =?UTF-8?q?a?= Date: Wed, 29 Oct 2025 20:56:55 -0400 Subject: [PATCH] made ogimage generation concurrent --- quartz/plugins/emitters/ogImage.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/quartz/plugins/emitters/ogImage.tsx b/quartz/plugins/emitters/ogImage.tsx index 813d9348c..af2aa5d44 100644 --- a/quartz/plugins/emitters/ogImage.tsx +++ b/quartz/plugins/emitters/ogImage.tsx @@ -114,11 +114,13 @@ export const CustomOgImages: QuartzEmitterPlugin> = const headerFont = cfg.theme.typography.header const bodyFont = cfg.theme.typography.body const fonts = await getSatoriFonts(headerFont, bodyFont) - - for (const [_tree, vfile] of content) { - if (vfile.data.frontmatter?.socialImage !== undefined) continue - yield processOgImage(ctx, vfile.data, fonts, fullOptions) - } + Promise.all( + content.map(([_tree, vfile]) => { + if (vfile.data.frontmatter?.socialImage !== undefined) { + processOgImage(ctx, vfile.data, fonts, fullOptions) + } + }), + ) }, async *partialEmit(ctx, _content, _resources, changeEvents) { const cfg = ctx.cfg.configuration