Hrishikesh Barman
2023-08-25 5c6d1e27baef74a42cc292276c5832b010a38fd5
quartz/plugins/transformers/frontmatter.ts
@@ -2,14 +2,17 @@
import remarkFrontmatter from "remark-frontmatter"
import { QuartzTransformerPlugin } from "../types"
import yaml from "js-yaml"
import toml from "toml"
import { slugTag } from "../../util/path"
export interface Options {
  delims: string | string[]
  language: "yaml" | "toml"
}
const defaultOptions: Options = {
  delims: "---",
  language: "yaml",
}
export const FrontMatter: QuartzTransformerPlugin<Partial<Options> | undefined> = (userOpts) => {
@@ -25,6 +28,7 @@
              ...opts,
              engines: {
                yaml: (s) => yaml.load(s, { schema: yaml.JSON_SCHEMA }) as object,
                toml: (s) => toml.parse(s) as object,
              },
            })