Implement RTL support for Arabic and Persian locales and update HTML direction attribute in renderPage component

This commit is contained in:
Amir Pourmand 2025-08-24 15:43:34 +03:30
parent 748e1788cb
commit 58a3735578
5 changed files with 5 additions and 7 deletions

View File

@ -231,8 +231,9 @@ export function renderPage(
)
const lang = componentData.fileData.frontmatter?.lang ?? cfg.locale?.split("-")[0] ?? "en"
const direction = i18n(cfg.locale).direction ?? "ltr"
const doc = (
<html lang={lang}>
<html lang={lang} dir={direction}>
<Head {...componentData} />
<body data-slug={slug}>
<div id="quartz-root" class="page">

View File

@ -5,6 +5,7 @@ export default {
title: "غير معنون",
description: "لم يتم تقديم أي وصف",
},
direction: "rtl" as const,
components: {
callout: {
note: "ملاحظة",

View File

@ -21,6 +21,7 @@ export interface Translation {
title: string
description: string
}
direction?: "ltr" | "rtl"
components: {
callout: CalloutTranslation
backlinks: {

View File

@ -5,6 +5,7 @@ export default {
title: "بدون عنوان",
description: "توضیح خاصی اضافه نشده است",
},
direction: "rtl" as const,
components: {
callout: {
note: "یادداشت",

View File

@ -645,9 +645,3 @@ iframe.pdf {
transition: width 0.2s ease;
z-index: 9999;
}
html[lang^="he"] *,
html[lang^="fa"] *,
html[lang^="ar"] * {
direction: rtl;
}