From 5dcb7e83fc3c8383ebbc84aac4553df4ad3ef59a Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Fri, 15 Sep 2023 16:46:06 +0000
Subject: [PATCH] fix: use git dates by default, @napi/git is fast enough
---
quartz/processors/emit.ts | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/quartz/processors/emit.ts b/quartz/processors/emit.ts
index 72d6085..3b357aa 100644
--- a/quartz/processors/emit.ts
+++ b/quartz/processors/emit.ts
@@ -1,13 +1,13 @@
import path from "path"
import fs from "fs"
-import { PerfTimer } from "../perf"
+import { PerfTimer } from "../util/perf"
import { getStaticResourcesFromPlugins } from "../plugins"
import { EmitCallback } from "../plugins/types"
import { ProcessedContent } from "../plugins/vfile"
-import { FilePath } from "../path"
-import { QuartzLogger } from "../log"
-import { trace } from "../trace"
-import { BuildCtx } from "../ctx"
+import { FilePath, joinSegments } from "../util/path"
+import { QuartzLogger } from "../util/log"
+import { trace } from "../util/trace"
+import { BuildCtx } from "../util/ctx"
export async function emitContent(ctx: BuildCtx, content: ProcessedContent[]) {
const { argv, cfg } = ctx
@@ -16,7 +16,7 @@
log.start(`Emitting output files`)
const emit: EmitCallback = async ({ slug, ext, content }) => {
- const pathToPage = path.join(argv.output, slug + ext) as FilePath
+ const pathToPage = joinSegments(argv.output, slug + ext) as FilePath
const dir = path.dirname(pathToPage)
await fs.promises.mkdir(dir, { recursive: true })
await fs.promises.writeFile(pathToPage, content)
@@ -37,7 +37,6 @@
}
} catch (err) {
trace(`Failed to emit from plugin \`${emitter.name}\``, err as Error)
- throw err
}
}
--
Gitblit v1.10.0