From 3e09b05468c372e85518ff76d8d6d9a415f61fac Mon Sep 17 00:00:00 2001
From: kon-foo <25391223+kon-foo@users.noreply.github.com>
Date: Mon, 19 Feb 2024 17:50:40 +0000
Subject: [PATCH] docs: add self-hosting section (#883)
---
quartz/plugins/transformers/frontmatter.ts | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/quartz/plugins/transformers/frontmatter.ts b/quartz/plugins/transformers/frontmatter.ts
index eae359e..7073d43 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",
}
@@ -43,7 +44,7 @@
const opts = { ...defaultOptions, ...userOpts }
return {
name: "FrontMatter",
- markdownPlugins() {
+ markdownPlugins({ cfg }) {
return [
[remarkFrontmatter, ["yaml", "toml"]],
() => {
@@ -59,7 +60,7 @@
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"]))
--
Gitblit v1.10.0