From 06d9e18599a5a93e924ecceac5e3c99b33c71094 Mon Sep 17 00:00:00 2001 From: ajmandourah Date: Thu, 28 Sep 2023 14:26:19 +0300 Subject: [PATCH 1/3] Adding arabic languag + shortcodes for ltr/rtl --- i18n/ar.yaml | 70 +++++++++++++++++++++++++++++++++++++ layouts/shortcodes/ltr.html | 3 ++ layouts/shortcodes/rtl.html | 3 ++ 3 files changed, 76 insertions(+) create mode 100644 i18n/ar.yaml create mode 100644 layouts/shortcodes/ltr.html create mode 100644 layouts/shortcodes/rtl.html diff --git a/i18n/ar.yaml b/i18n/ar.yaml new file mode 100644 index 00000000..59c6cb1c --- /dev/null +++ b/i18n/ar.yaml @@ -0,0 +1,70 @@ +global: + language: "AR" + +article: + anchor_label: "رابط" + date: "{{ .Date }}" + date_updated: "Updated: {{ .Date }}" + draft: "مسودة" + edit_title: "تعديل المحتوى" + reading_time: + one: "{{ .Count }} دقيقة قراءة" + other: "{{ .Count }} دقيقة/دقائق قراءة" + reading_time_title: "مدة القراءة" + table_of_contents: "محتوى المقال" + word_count: + one: "{{ .Count }} كلمة" + other: "{{ .Count }} كلمة" + views: + one: "{{ .Count }} view" + other: "{{ .Count }} views" + likes: + one: "{{ .Count }} like" + other: "{{ .Count }} likes" + part_of_series: "هذا المقال جزء من سلسلة." + part: "جزء" + this_article: "هذه المقالة" + +author: + byline_title: "الناشر" + +code: + copy: "نسخ" + copied: "تم النسخ" + +error: + 404_title: "هذه الصفحة غير موجودة :confused:" + 404_error: "خطأ 404" + 404_description: "يبدو أن الصفحة التي طلبتها غير موجودة." + +footer: + dark_appearance: "التحويل الى المظهر الداكن" + light_appearance: "التحويل الى المظهر الفاتح" + powered_by: "Powered by {{ .Hugo }} & {{ .Theme }}" + +list: + externalurl_title: "ارتباط بموقع خارجي" + no_articles: "لا توجد مقالات لسردها هنا حتى الآن." + +nav: + scroll_to_top_title: "انتقل إلى أعلى" + skip_to_main: "التخطى الى المحتوى الأساسى" + +search: + open_button_title: "البحث (/)" + close_button_title: "إقفل (Esc)" + input_placeholder: "إبحث" + +sharing: + email: "إرسال عبر البريد الإلكترونى" + facebook: "النشر على فيسبوك" + linkedin: "النشر على لينكدان" + pinterest: "النشر على بينترست" + reddit: "النشر على ريديت" + twitter: "النشر على تويتر" + +shortcode: + recent_articles: "تم النشر مؤخرا" + +recent: + show_more: "قراءة المزيد" \ No newline at end of file diff --git a/layouts/shortcodes/ltr.html b/layouts/shortcodes/ltr.html new file mode 100644 index 00000000..40295160 --- /dev/null +++ b/layouts/shortcodes/ltr.html @@ -0,0 +1,3 @@ +
+{{ .Inner }} +
\ No newline at end of file diff --git a/layouts/shortcodes/rtl.html b/layouts/shortcodes/rtl.html new file mode 100644 index 00000000..51f9a69e --- /dev/null +++ b/layouts/shortcodes/rtl.html @@ -0,0 +1,3 @@ +
+ {{ .Inner }} +
\ No newline at end of file From aaa76e04d331fbddbb725c0dce986591810a753a Mon Sep 17 00:00:00 2001 From: ajmandourah Date: Fri, 29 Sep 2023 08:04:48 +0300 Subject: [PATCH 2/3] adding LTR/RTL shortcodes to the docs + implement Tailwind classes for the ltr/rtl shortcodes --- exampleSite/content/docs/shortcodes/index.md | 24 ++++++++++++++++++++ layouts/shortcodes/ltr.html | 2 +- layouts/shortcodes/rtl.html | 2 +- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/exampleSite/content/docs/shortcodes/index.md b/exampleSite/content/docs/shortcodes/index.md index 84091d30..3dbbe3b7 100644 --- a/exampleSite/content/docs/shortcodes/index.md +++ b/exampleSite/content/docs/shortcodes/index.md @@ -431,6 +431,30 @@ The `where` and `value` values are used in the following query `where .Site.Regu


+## LTR/RTL + +`ltr` and `rtl` allows you to mix your contents. Many RTL language users want to include parts of the content in LTR. Using this shortcode will let you do so, and by leveraging `%` as the outer-most dilemeter in the shortcode [Hugo shortcodes](https://gohugo.io/content-management/shortcodes/#shortcodes-with-markdown), any markdown inside will be rendered normally. + +**Example:** + +```md +- This is an markdown list. +- Its per default a LTR direction +{{% rtl %}} +- هذه القائمة باللغة العربية +- من اليمين الى اليسار +{{% /rtl %}} +``` + +- This is an markdown list. +- Its per default a LTR direction +{{% rtl %}} +- هذه القائمة باللغة العربية +- من اليمين الى اليسار +{{% /rtl %}} + +


+ ## Mermaid `mermaid` allows you to draw detailed diagrams and visualisations using text. It uses Mermaid under the hood and supports a wide variety of diagrams, charts and other output formats. diff --git a/layouts/shortcodes/ltr.html b/layouts/shortcodes/ltr.html index 40295160..d3c4a291 100644 --- a/layouts/shortcodes/ltr.html +++ b/layouts/shortcodes/ltr.html @@ -1,3 +1,3 @@ -
+
{{ .Inner }}
\ No newline at end of file diff --git a/layouts/shortcodes/rtl.html b/layouts/shortcodes/rtl.html index 51f9a69e..2947a9df 100644 --- a/layouts/shortcodes/rtl.html +++ b/layouts/shortcodes/rtl.html @@ -1,3 +1,3 @@ -
+
{{ .Inner }}
\ No newline at end of file From 8557ad92bb699c99e3fd74ca4f6401ccc270e661 Mon Sep 17 00:00:00 2001 From: ajmandourah Date: Fri, 29 Sep 2023 08:16:02 +0300 Subject: [PATCH 3/3] code highlighting. --- exampleSite/content/docs/shortcodes/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exampleSite/content/docs/shortcodes/index.md b/exampleSite/content/docs/shortcodes/index.md index 3dbbe3b7..19b425b3 100644 --- a/exampleSite/content/docs/shortcodes/index.md +++ b/exampleSite/content/docs/shortcodes/index.md @@ -440,10 +440,10 @@ The `where` and `value` values are used in the following query `where .Site.Regu ```md - This is an markdown list. - Its per default a LTR direction -{{% rtl %}} +{{%/* rtl */%}} - هذه القائمة باللغة العربية - من اليمين الى اليسار -{{% /rtl %}} +{{%/* /rtl */%}} ``` - This is an markdown list.