mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-19 10:54:06 -06:00
made ogimage generation concurrent
This commit is contained in:
parent
08c861707b
commit
feb5a5c74d
@ -114,11 +114,13 @@ export const CustomOgImages: QuartzEmitterPlugin<Partial<SocialImageOptions>> =
|
||||
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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user