mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-24 13:24:05 -06:00
type fixes
This commit is contained in:
parent
f2c426ba33
commit
fa97c7161a
@ -67,7 +67,8 @@ export const FrontMatter: QuartzTransformerPlugin<Partial<Options>> = (userOpts)
|
||||
[remarkFrontmatter, ["yaml", "toml"]],
|
||||
() => {
|
||||
return (_, file) => {
|
||||
const { data } = matter(Buffer.from(file.value), {
|
||||
const fileData = Buffer.from(file.value as Uint8Array)
|
||||
const { data } = matter(fileData, {
|
||||
...opts,
|
||||
engines: {
|
||||
yaml: (s) => yaml.load(s, { schema: yaml.JSON_SCHEMA }) as object,
|
||||
|
||||
@ -95,7 +95,7 @@ export function createFileParser(ctx: BuildCtx, fps: FilePath[]) {
|
||||
|
||||
// Text -> Text transforms
|
||||
for (const plugin of cfg.plugins.transformers.filter((p) => p.textTransform)) {
|
||||
file.value = plugin.textTransform!(ctx, file.value.toString())
|
||||
file.value = plugin.textTransform!(ctx, Buffer.from(file.value as Uint8Array))
|
||||
}
|
||||
|
||||
// base data properties that plugins may use
|
||||
|
||||
Loading…
Reference in New Issue
Block a user