Jacky Zhao
2023-06-04 1406ee0f05dc688e1b7635d3ce14e63d1c42a973
quartz/processors/emit.ts
@@ -7,6 +7,7 @@
import { ProcessedContent } from "../plugins/vfile"
import { QUARTZ, slugify } from "../path"
import { globbyStream } from "globby"
import chalk from "chalk"
export async function emitContent(contentFolder: string, output: string, cfg: QuartzConfig, content: ProcessedContent[], verbose: boolean) {
  const perf = new PerfTimer()
@@ -23,6 +24,7 @@
  let emittedFiles = 0
  for (const emitter of cfg.plugins.emitters) {
    try {
    const emitted = await emitter.emit(cfg.configuration, content, staticResources, emit)
    emittedFiles += emitted.length
@@ -31,6 +33,10 @@
        console.log(`[emit:${emitter.name}] ${file}`)
      }
    }
    } catch (err) {
      console.log(chalk.red(`Failed to emit from plugin \`${emitter.name}\`: `) + err)
      process.exit(1)
    }
  }
  const staticPath = path.join(QUARTZ, "static")