From b30a200bd4ddc64f4fd3d2124fcda0b354847073 Mon Sep 17 00:00:00 2001 From: Aaron Pham <29749331+aarnphm@users.noreply.github.com> Date: Fri, 8 Mar 2024 12:14:22 -0500 Subject: [PATCH] fix(i18n): make sure to use correct fileData for manual localization (#975) Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com> --- quartz/components/renderPage.tsx | 2 +- quartz/plugins/transformers/frontmatter.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/quartz/components/renderPage.tsx b/quartz/components/renderPage.tsx index 7a97edb..0c18544 100644 --- a/quartz/components/renderPage.tsx +++ b/quartz/components/renderPage.tsx @@ -209,7 +209,7 @@ export function renderPage( ) - const lang = componentData.frontmatter?.lang ?? cfg.locale?.split("-")[0] ?? "en" + const lang = componentData.fileData.frontmatter?.lang ?? cfg.locale?.split("-")[0] ?? "en" const doc = ( diff --git a/quartz/plugins/transformers/frontmatter.ts b/quartz/plugins/transformers/frontmatter.ts index 79aa5f3..5ab239a 100644 --- a/quartz/plugins/transformers/frontmatter.ts +++ b/quartz/plugins/transformers/frontmatter.ts @@ -90,6 +90,7 @@ declare module "vfile" { description: string publish: boolean draft: boolean + lang: string enableToc: string cssclasses: string[] }>