From e47c29d2fd4eae06c511c914e2a5fcb057b44d7b Mon Sep 17 00:00:00 2001
From: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 19 Aug 2024 21:14:29 +0000
Subject: [PATCH] chore(deps): bump rehype-katex from 7.0.0 to 7.0.1 (#1356)
---
quartz/plugins/transformers/frontmatter.ts | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/quartz/plugins/transformers/frontmatter.ts b/quartz/plugins/transformers/frontmatter.ts
index eae359e..70a60d8 100644
--- a/quartz/plugins/transformers/frontmatter.ts
+++ b/quartz/plugins/transformers/frontmatter.ts
@@ -5,14 +5,15 @@
import toml from "toml"
import { slugTag } from "../../util/path"
import { QuartzPluginData } from "../vfile"
+import { i18n } from "../../i18n"
export interface Options {
- delims: string | string[]
+ delimiters: string | [string, string]
language: "yaml" | "toml"
}
const defaultOptions: Options = {
- delims: "---",
+ delimiters: "---",
language: "yaml",
}
@@ -39,11 +40,11 @@
.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",
- markdownPlugins() {
+ markdownPlugins({ cfg }) {
return [
[remarkFrontmatter, ["yaml", "toml"]],
() => {
@@ -56,10 +57,10 @@
},
})
- if (data.title) {
+ if (data.title != null && data.title.toString() !== "") {
data.title = data.title.toString()
- } else if (data.title === null || data.title === undefined) {
- data.title = file.stem ?? "Untitled"
+ } else {
+ data.title = file.stem ?? i18n(cfg.configuration.locale).propertyDefaults.title
}
const tags = coerceToArray(coalesceAliases(data, ["tags", "tag"]))
@@ -89,6 +90,7 @@
description: string
publish: boolean
draft: boolean
+ lang: string
enableToc: string
cssclasses: string[]
}>
--
Gitblit v1.10.0