| | |
| | | import remarkFrontmatter from "remark-frontmatter" |
| | | import { QuartzTransformerPlugin } from "../types" |
| | | import yaml from "js-yaml" |
| | | import { slug as slugAnchor } from "github-slugger" |
| | | import { slugTag } from "../../path" |
| | | |
| | | export interface Options { |
| | | language: "yaml" | "toml" |
| | | delims: string | string[] |
| | | } |
| | | |
| | | const defaultOptions: Options = { |
| | | language: "yaml", |
| | | delims: "---", |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | // slug them all!! |
| | | data.tags = data.tags?.map((tag: string) => slugAnchor(tag)) ?? [] |
| | | data.tags = data.tags?.map((tag: string) => slugTag(tag)) ?? [] |
| | | |
| | | // fill in frontmatter |
| | | file.data.frontmatter = { |