From 7bde99b4e2d49e30dad1e0d58ccc34c2e7482005 Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Mon, 14 Aug 2023 00:47:18 +0000
Subject: [PATCH] fix: add trailing slash to local serving
---
quartz/processors/emit.ts | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/quartz/processors/emit.ts b/quartz/processors/emit.ts
index 72d6085..fd32685 100644
--- a/quartz/processors/emit.ts
+++ b/quartz/processors/emit.ts
@@ -4,7 +4,7 @@
import { getStaticResourcesFromPlugins } from "../plugins"
import { EmitCallback } from "../plugins/types"
import { ProcessedContent } from "../plugins/vfile"
-import { FilePath } from "../path"
+import { FilePath, joinSegments } from "../path"
import { QuartzLogger } from "../log"
import { trace } from "../trace"
import { BuildCtx } from "../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