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 headerFont = cfg.theme.typography.header
|
||||||
const bodyFont = cfg.theme.typography.body
|
const bodyFont = cfg.theme.typography.body
|
||||||
const fonts = await getSatoriFonts(headerFont, bodyFont)
|
const fonts = await getSatoriFonts(headerFont, bodyFont)
|
||||||
|
Promise.all(
|
||||||
for (const [_tree, vfile] of content) {
|
content.map(([_tree, vfile]) => {
|
||||||
if (vfile.data.frontmatter?.socialImage !== undefined) continue
|
if (vfile.data.frontmatter?.socialImage !== undefined) {
|
||||||
yield processOgImage(ctx, vfile.data, fonts, fullOptions)
|
processOgImage(ctx, vfile.data, fonts, fullOptions)
|
||||||
}
|
}
|
||||||
|
}),
|
||||||
|
)
|
||||||
},
|
},
|
||||||
async *partialEmit(ctx, _content, _resources, changeEvents) {
|
async *partialEmit(ctx, _content, _resources, changeEvents) {
|
||||||
const cfg = ctx.cfg.configuration
|
const cfg = ctx.cfg.configuration
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user