| | |
| | | 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() |
| | |
| | | |
| | | let emittedFiles = 0 |
| | | for (const emitter of cfg.plugins.emitters) { |
| | | try { |
| | | const emitted = await emitter.emit(cfg.configuration, content, staticResources, emit) |
| | | emittedFiles += emitted.length |
| | | |
| | |
| | | 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") |