mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-05-18 06:24:22 +02:00
fix
This commit is contained in:
parent
c5a8b199ae
commit
1fb7756c49
@ -115,9 +115,7 @@ export const myImage: SocialImageOptions["imageStructure"] = (...) => {
|
|||||||
> const bodyWeight: FontWeight = 400
|
> const bodyWeight: FontWeight = 400
|
||||||
>
|
>
|
||||||
> const [header, body] = await Promise.all(
|
> const [header, body] = await Promise.all(
|
||||||
> [headerFont, bodyFont].map((font) =>
|
> [headerFont, bodyFont].map((font) => fs.promises.readFile(path.resolve(font))),
|
||||||
> fs.promises.readFile(path.resolve(font))
|
|
||||||
> ),
|
|
||||||
> )
|
> )
|
||||||
>
|
>
|
||||||
> return [
|
> return [
|
||||||
|
@ -250,15 +250,25 @@ async function partialRebuildFromEntrypoint(
|
|||||||
([_node, vfile]) => !toRemove.has(vfile.data.filePath!),
|
([_node, vfile]) => !toRemove.has(vfile.data.filePath!),
|
||||||
)
|
)
|
||||||
|
|
||||||
const emittedFps = await emitter.emit(ctx, files, staticResources)
|
const emitted = await emitter.emit(ctx, files, staticResources)
|
||||||
|
if (Symbol.asyncIterator in emitted) {
|
||||||
if (ctx.argv.verbose) {
|
// Async generator case
|
||||||
for (const file of emittedFps) {
|
for await (const file of emitted) {
|
||||||
console.log(`[emit:${emitter.name}] ${file}`)
|
emittedFiles++
|
||||||
|
if (ctx.argv.verbose) {
|
||||||
|
console.log(`[emit:${emitter.name}] ${file}`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Array case
|
||||||
|
emittedFiles += emitted.length
|
||||||
|
if (ctx.argv.verbose) {
|
||||||
|
for (const file of emitted) {
|
||||||
|
console.log(`[emit:${emitter.name}] ${file}`)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
emittedFiles += emittedFps.length
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -280,15 +290,24 @@ async function partialRebuildFromEntrypoint(
|
|||||||
.filter((file) => !toRemove.has(file))
|
.filter((file) => !toRemove.has(file))
|
||||||
.map((file) => contentMap.get(file)!)
|
.map((file) => contentMap.get(file)!)
|
||||||
|
|
||||||
const emittedFps = await emitter.emit(ctx, upstreamContent, staticResources)
|
const emitted = await emitter.emit(ctx, upstreamContent, staticResources)
|
||||||
|
if (Symbol.asyncIterator in emitted) {
|
||||||
if (ctx.argv.verbose) {
|
// Async generator case
|
||||||
for (const file of emittedFps) {
|
for await (const file of emitted) {
|
||||||
console.log(`[emit:${emitter.name}] ${file}`)
|
emittedFiles++
|
||||||
|
if (ctx.argv.verbose) {
|
||||||
|
console.log(`[emit:${emitter.name}] ${file}`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Array case
|
||||||
|
emittedFiles += emitted.length
|
||||||
|
if (ctx.argv.verbose) {
|
||||||
|
for (const file of emitted) {
|
||||||
|
console.log(`[emit:${emitter.name}] ${file}`)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
emittedFiles += emittedFps.length
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,9 +20,7 @@ export async function emitContent(ctx: BuildCtx, content: ProcessedContent[]) {
|
|||||||
const emitted = await emitter.emit(ctx, content, staticResources)
|
const emitted = await emitter.emit(ctx, content, staticResources)
|
||||||
if (Symbol.asyncIterator in emitted) {
|
if (Symbol.asyncIterator in emitted) {
|
||||||
// Async generator case
|
// Async generator case
|
||||||
const files: string[] = []
|
|
||||||
for await (const file of emitted) {
|
for await (const file of emitted) {
|
||||||
files.push(file)
|
|
||||||
emittedFiles++
|
emittedFiles++
|
||||||
if (ctx.argv.verbose) {
|
if (ctx.argv.verbose) {
|
||||||
console.log(`[emit:${emitter.name}] ${file}`)
|
console.log(`[emit:${emitter.name}] ${file}`)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user