| | |
| | | import toml from "toml" |
| | | import { slugTag } from "../../util/path" |
| | | import { QuartzPluginData } from "../vfile" |
| | | import { i18n } from "../../i18n" |
| | | |
| | | export interface Options { |
| | | delims: string | string[] |
| | |
| | | const opts = { ...defaultOptions, ...userOpts } |
| | | return { |
| | | name: "FrontMatter", |
| | | markdownPlugins() { |
| | | markdownPlugins({ cfg }) { |
| | | return [ |
| | | [remarkFrontmatter, ["yaml", "toml"]], |
| | | () => { |
| | |
| | | if (data.title) { |
| | | data.title = data.title.toString() |
| | | } else if (data.title === null || data.title === undefined) { |
| | | data.title = file.stem ?? "Untitled" |
| | | data.title = file.stem ?? i18n(cfg.configuration.locale).propertyDefaults.title |
| | | } |
| | | |
| | | const tags = coerceToArray(coalesceAliases(data, ["tags", "tag"])) |