diff --git a/quartz/plugins/transformers/frontmatter.ts b/quartz/plugins/transformers/frontmatter.ts index 04b1105c3..017d3d1f1 100644 --- a/quartz/plugins/transformers/frontmatter.ts +++ b/quartz/plugins/transformers/frontmatter.ts @@ -8,11 +8,13 @@ import { slugTag } from "../../util/path" export interface Options { delims: string | string[] language: "yaml" | "toml" + oneLineTagDelim: string } const defaultOptions: Options = { delims: "---", language: "yaml", + oneLineTagDelim: ",", } export const FrontMatter: QuartzTransformerPlugin | undefined> = (userOpts) => { @@ -20,6 +22,8 @@ export const FrontMatter: QuartzTransformerPlugin | undefined> return { name: "FrontMatter", markdownPlugins() { + const { oneLineTagDelim } = opts + return [ [remarkFrontmatter, ["yaml", "toml"]], () => { @@ -45,7 +49,7 @@ export const FrontMatter: QuartzTransformerPlugin | undefined> if (data.tags && !Array.isArray(data.tags)) { data.tags = data.tags .toString() - .split(",") + .split(oneLineTagDelim) .map((tag: string) => tag.trim()) }