| | |
| | | import { i18n } from "../../i18n" |
| | | |
| | | export interface Options { |
| | | delims: string | string[] |
| | | delimiters: string | [string, string] |
| | | language: "yaml" | "toml" |
| | | } |
| | | |
| | | const defaultOptions: Options = { |
| | | delims: "---", |
| | | delimiters: "---", |
| | | language: "yaml", |
| | | } |
| | | |
| | |
| | | .map((tag: string | number) => tag.toString()) |
| | | } |
| | | |
| | | export const FrontMatter: QuartzTransformerPlugin<Partial<Options> | undefined> = (userOpts) => { |
| | | export const FrontMatter: QuartzTransformerPlugin<Partial<Options>> = (userOpts) => { |
| | | const opts = { ...defaultOptions, ...userOpts } |
| | | return { |
| | | name: "FrontMatter", |
| | |
| | | }, |
| | | }) |
| | | |
| | | if (data.title) { |
| | | if (data.title != null && data.title.toString() !== "") { |
| | | data.title = data.title.toString() |
| | | } else if (data.title === null || data.title === undefined) { |
| | | } else { |
| | | data.title = file.stem ?? i18n(cfg.configuration.locale).propertyDefaults.title |
| | | } |
| | | |
| | |
| | | tags: string[] |
| | | aliases: string[] |
| | | description: string |
| | | publish: boolean |
| | | draft: boolean |
| | | publish: boolean | string |
| | | draft: boolean | string |
| | | lang: string |
| | | enableToc: string |
| | | cssclasses: string[] |
| | | comments: boolean | string |
| | | }> |
| | | } |
| | | } |