From 2578597f7ec7e932f5e30e2c38995dc9dd6eac75 Mon Sep 17 00:00:00 2001
From: Aaron Pham <29749331+aarnphm@users.noreply.github.com>
Date: Wed, 07 Feb 2024 17:29:47 +0000
Subject: [PATCH] chore(lang): lang element based on frontmatter or default locale (#819)
---
quartz/components/renderPage.tsx | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/quartz/components/renderPage.tsx b/quartz/components/renderPage.tsx
index fa8305d..d6bcf0a 100644
--- a/quartz/components/renderPage.tsx
+++ b/quartz/components/renderPage.tsx
@@ -104,7 +104,9 @@
type: "element",
tagName: "a",
properties: { href: inner.properties?.href, class: ["internal"] },
- children: [{ type: "text", value: `Link to original` }],
+ children: [
+ { type: "text", value: i18n(cfg.locale).components.transcludes.linkToOriginal },
+ ],
},
]
}
@@ -207,8 +209,10 @@
</div>
)
+ const lang = componentData.frontmatter?.lang ?? cfg.locale.split("-")[0]
+
const doc = (
- <html>
+ <html lang={lang}>
<Head {...componentData} />
<body data-slug={slug}>
<div id="quartz-root" class="page">
--
Gitblit v1.10.0