From ac6fa96c9ce1a5e522199803b9edd841536a1205 Mon Sep 17 00:00:00 2001 From: Al Murad Uzzaman Date: Tue, 14 May 2024 15:34:22 +0600 Subject: [PATCH] project setup --- astro.config.mjs | 9 +- package.json | 2 +- readme.md | 2 +- src/config/config.json | 5 + src/config/menu.ar.json | 24 ++ src/config/menu.en.json | 24 ++ src/config/menu.fr.json | 24 ++ src/content/ar/about/-index.md | 9 + src/content/ar/authors/-index.md | 5 + src/content/ar/authors/john-doe.md | 20 ++ src/content/ar/authors/sam-wilson.md | 20 ++ src/content/ar/authors/william-jacob.md | 20 ++ src/content/ar/blog/-index.md | 5 + src/content/ar/blog/post-1.md | 23 ++ src/content/{ => ar}/blog/post-2.md | 0 src/content/{ => ar}/blog/post-3.md | 0 src/content/{ => ar}/blog/post-4.md | 0 src/content/{ => ar}/contact/-index.md | 0 src/content/ar/homepage/-index.md | 53 ++++ src/content/ar/pages/elements.mdx | 255 ++++++++++++++++++ src/content/ar/pages/privacy-policy.md | 30 +++ src/content/ar/sections/call-to-action.md | 10 + src/content/ar/sections/testimonial.md | 27 ++ src/content/{ => en}/about/-index.md | 0 src/content/{ => en}/authors/-index.md | 0 src/content/{ => en}/authors/john-doe.md | 0 src/content/{ => en}/authors/sam-wilson.md | 0 src/content/{ => en}/authors/william-jacob.md | 0 src/content/{ => en}/blog/-index.md | 0 src/content/{ => en}/blog/post-1.md | 0 src/content/en/blog/post-2.md | 23 ++ src/content/en/blog/post-3.md | 23 ++ src/content/en/blog/post-4.md | 23 ++ src/content/en/contact/-index.md | 6 + src/content/{ => en}/homepage/-index.md | 0 src/content/{ => en}/pages/elements.mdx | 0 src/content/{ => en}/pages/privacy-policy.md | 0 .../{ => en}/sections/call-to-action.md | 0 src/content/{ => en}/sections/testimonial.md | 0 src/content/fr/about/-index.md | 9 + src/content/fr/authors/-index.md | 5 + src/content/fr/authors/john-doe.md | 20 ++ src/content/fr/authors/sam-wilson.md | 20 ++ src/content/fr/authors/william-jacob.md | 20 ++ src/content/fr/blog/-index.md | 5 + src/content/fr/blog/post-1.md | 23 ++ src/content/fr/blog/post-2.md | 23 ++ src/content/fr/blog/post-3.md | 23 ++ src/content/fr/blog/post-4.md | 23 ++ src/content/fr/contact/-index.md | 6 + src/content/fr/homepage/-index.md | 53 ++++ src/content/fr/pages/elements.mdx | 255 ++++++++++++++++++ src/content/fr/pages/privacy-policy.md | 30 +++ src/content/fr/sections/call-to-action.md | 10 + src/content/fr/sections/testimonial.md | 27 ++ src/i18n/ar.json | 42 +++ src/i18n/en.json | 42 +++ src/i18n/fr.json | 42 +++ src/i18n/ui.ts | 63 +++++ src/layouts/Base.astro | 21 +- src/layouts/PostSingle.astro | 7 +- src/layouts/components/AuthorCard.astro | 6 +- src/layouts/components/BlogCard.astro | 18 +- src/layouts/components/Pagination.astro | 21 +- src/layouts/partials/Header.astro | 86 ++++-- src/lib/contentParser.astro | 46 +++- src/lib/taxonomyParser.astro | 19 +- src/lib/utils/i18nUtils.ts | 62 +++++ src/lib/utils/loadMenu.ts | 25 ++ src/pages/404.astro | 22 +- src/pages/{ => [...lang]}/[regular].astro | 28 +- src/pages/{ => [...lang]}/about.astro | 19 +- .../{ => [...lang]}/authors/[single].astro | 35 ++- src/pages/[...lang]/authors/index.astro | 45 ++++ src/pages/[...lang]/blog/[single].astro | 41 +++ src/pages/{ => [...lang]}/blog/index.astro | 35 ++- .../{ => [...lang]}/blog/page/[slug].astro | 76 ++++-- .../categories/[category].astro | 31 ++- .../{ => [...lang]}/categories/index.astro | 16 +- src/pages/{ => [...lang]}/contact.astro | 29 +- src/pages/{ => [...lang]}/index.astro | 43 ++- src/pages/authors/index.astro | 29 -- src/pages/blog/[single].astro | 30 --- src/pages/tags/[tag].astro | 45 ---- src/pages/tags/index.astro | 39 --- src/styles/base.scss | 2 +- 86 files changed, 1966 insertions(+), 293 deletions(-) create mode 100644 src/config/menu.ar.json create mode 100644 src/config/menu.en.json create mode 100644 src/config/menu.fr.json create mode 100644 src/content/ar/about/-index.md create mode 100644 src/content/ar/authors/-index.md create mode 100644 src/content/ar/authors/john-doe.md create mode 100644 src/content/ar/authors/sam-wilson.md create mode 100644 src/content/ar/authors/william-jacob.md create mode 100755 src/content/ar/blog/-index.md create mode 100755 src/content/ar/blog/post-1.md rename src/content/{ => ar}/blog/post-2.md (100%) rename src/content/{ => ar}/blog/post-3.md (100%) rename src/content/{ => ar}/blog/post-4.md (100%) rename src/content/{ => ar}/contact/-index.md (100%) create mode 100755 src/content/ar/homepage/-index.md create mode 100755 src/content/ar/pages/elements.mdx create mode 100644 src/content/ar/pages/privacy-policy.md create mode 100644 src/content/ar/sections/call-to-action.md create mode 100644 src/content/ar/sections/testimonial.md rename src/content/{ => en}/about/-index.md (100%) rename src/content/{ => en}/authors/-index.md (100%) rename src/content/{ => en}/authors/john-doe.md (100%) rename src/content/{ => en}/authors/sam-wilson.md (100%) rename src/content/{ => en}/authors/william-jacob.md (100%) rename src/content/{ => en}/blog/-index.md (100%) rename src/content/{ => en}/blog/post-1.md (100%) create mode 100755 src/content/en/blog/post-2.md create mode 100755 src/content/en/blog/post-3.md create mode 100755 src/content/en/blog/post-4.md create mode 100644 src/content/en/contact/-index.md rename src/content/{ => en}/homepage/-index.md (100%) rename src/content/{ => en}/pages/elements.mdx (100%) rename src/content/{ => en}/pages/privacy-policy.md (100%) rename src/content/{ => en}/sections/call-to-action.md (100%) rename src/content/{ => en}/sections/testimonial.md (100%) create mode 100644 src/content/fr/about/-index.md create mode 100644 src/content/fr/authors/-index.md create mode 100644 src/content/fr/authors/john-doe.md create mode 100644 src/content/fr/authors/sam-wilson.md create mode 100644 src/content/fr/authors/william-jacob.md create mode 100755 src/content/fr/blog/-index.md create mode 100755 src/content/fr/blog/post-1.md create mode 100755 src/content/fr/blog/post-2.md create mode 100755 src/content/fr/blog/post-3.md create mode 100755 src/content/fr/blog/post-4.md create mode 100644 src/content/fr/contact/-index.md create mode 100755 src/content/fr/homepage/-index.md create mode 100755 src/content/fr/pages/elements.mdx create mode 100644 src/content/fr/pages/privacy-policy.md create mode 100644 src/content/fr/sections/call-to-action.md create mode 100644 src/content/fr/sections/testimonial.md create mode 100644 src/i18n/ar.json create mode 100644 src/i18n/en.json create mode 100644 src/i18n/fr.json create mode 100644 src/i18n/ui.ts create mode 100644 src/lib/utils/i18nUtils.ts create mode 100644 src/lib/utils/loadMenu.ts rename src/pages/{ => [...lang]}/[regular].astro (58%) rename src/pages/{ => [...lang]}/about.astro (60%) rename src/pages/{ => [...lang]}/authors/[single].astro (68%) create mode 100755 src/pages/[...lang]/authors/index.astro create mode 100755 src/pages/[...lang]/blog/[single].astro rename src/pages/{ => [...lang]}/blog/index.astro (56%) rename src/pages/{ => [...lang]}/blog/page/[slug].astro (51%) rename src/pages/{ => [...lang]}/categories/[category].astro (62%) rename src/pages/{ => [...lang]}/categories/index.astro (63%) rename src/pages/{ => [...lang]}/contact.astro (62%) rename src/pages/{ => [...lang]}/index.astro (71%) delete mode 100755 src/pages/authors/index.astro delete mode 100755 src/pages/blog/[single].astro delete mode 100755 src/pages/tags/[tag].astro delete mode 100755 src/pages/tags/index.astro diff --git a/astro.config.mjs b/astro.config.mjs index d2c210c..78e24b3 100755 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -12,7 +12,14 @@ import config from "./src/config/config.json"; export default defineConfig({ site: config.site.base_url ? config.site.base_url : "http://examplesite.com", base: config.site.base_path ? config.site.base_path : "/", - trailingSlash: config.site.trailing_slash ? "always" : "never", + trailingSlash: config.site.trailing_slash ? "always" : "ignore", + i18n: { + locales: ["en", "fr", "ar"], + defaultLocale: "en", + routing: { + prefixDefaultLocale: false, + }, + }, image: { service: squooshImageService(), }, diff --git a/package.json b/package.json index 5f30638..e166388 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "astroplate", - "version": "3.4.5", + "version": "3.4.3", "description": "Astro and Tailwindcss boilerplate", "author": "zeon.studio", "license": "MIT", diff --git a/readme.md b/readme.md index a9badb4..d098e30 100755 --- a/readme.md +++ b/readme.md @@ -6,7 +6,7 @@

If you find this project useful, please give it a ⭐ to show your support.

-

👀 Demo | Page Speed (100%)🚀 +

👀 Demo | Page Speed (100%)🚀

diff --git a/src/config/config.json b/src/config/config.json index 683fe50..0e5aab5 100755 --- a/src/config/config.json +++ b/src/config/config.json @@ -12,6 +12,11 @@ "logo_text": "Astroplate" }, + "language": { + "defaultLang": "en", + "supported": ["", "en", "fr", "ar"] + }, + "settings": { "search": true, "sticky_header": true, diff --git a/src/config/menu.ar.json b/src/config/menu.ar.json new file mode 100644 index 0000000..227048e --- /dev/null +++ b/src/config/menu.ar.json @@ -0,0 +1,24 @@ +{ + "main": [ + { "name": "الرئيسية", "url": "/" }, + { "name": "نبذة عنا", "url": "/about" }, + { "name": "العناصر", "url": "/elements" }, + { + "name": "Pages", + "url": "", + "hasChildren": true, + "children": [ + { "name": "اتصل بنا", "url": "/contact" }, + { "name": "المدونة", "url": "/blog" }, + { "name": "المؤلفون", "url": "/authors" }, + { "name": "التصنيفات", "url": "/categories" }, + { "name": "العلامات", "url": "/tags" }, + { "name": "صفحة 404", "url": "/404" } + ] + } + ], + "footer": [ + { "name": "العناصر", "url": "/elements" }, + { "name": "سياسة الخصوصية", "url": "/privacy-policy" } + ] +} diff --git a/src/config/menu.en.json b/src/config/menu.en.json new file mode 100644 index 0000000..74697c8 --- /dev/null +++ b/src/config/menu.en.json @@ -0,0 +1,24 @@ +{ + "main": [ + { "name": "Home", "url": "/" }, + { "name": "About", "url": "/about" }, + { "name": "Elements", "url": "/elements" }, + { + "name": "Pages", + "url": "", + "hasChildren": true, + "children": [ + { "name": "Contact", "url": "/contact" }, + { "name": "Blog", "url": "/blog" }, + { "name": "Authors", "url": "/authors" }, + { "name": "Categories", "url": "/categories" }, + { "name": "Tags", "url": "/tags" }, + { "name": "404 Page", "url": "/404" } + ] + } + ], + "footer": [ + { "name": "Elements", "url": "/elements" }, + { "name": "Privacy Policy", "url": "/privacy-policy" } + ] +} \ No newline at end of file diff --git a/src/config/menu.fr.json b/src/config/menu.fr.json new file mode 100644 index 0000000..88b02d5 --- /dev/null +++ b/src/config/menu.fr.json @@ -0,0 +1,24 @@ +{ + "main": [ + { "name": "Accueil", "url": "/" }, + { "name": "À propos", "url": "/about" }, + { "name": "Éléments", "url": "/elements" }, + { + "name": "Pages", + "url": "", + "hasChildren": true, + "children": [ + { "name": "Contact", "url": "/contact" }, + { "name": "Blog", "url": "/blog" }, + { "name": "Auteurs", "url": "/authors" }, + { "name": "Catégories", "url": "/categories" }, + { "name": "Étiquettes", "url": "/tags" }, + { "name": "Page 404", "url": "/404" } + ] + } + ], + "footer": [ + { "name": "Éléments", "url": "/elements" }, + { "name": "Politique de confidentialité", "url": "/privacy-policy" } + ] +} \ No newline at end of file diff --git a/src/content/ar/about/-index.md b/src/content/ar/about/-index.md new file mode 100644 index 0000000..4b8e44a --- /dev/null +++ b/src/content/ar/about/-index.md @@ -0,0 +1,9 @@ +--- +title: "مهلا، أنا جون دو!" +meta_title: "About" +description: "this is meta description" +image: "/images/avatar.png" +draft: false +--- + +الشركة نفسها هي شركة ناجحة جدا. إنهم لا يعرفون فوائد الجسد، أو إلا أنهم سيحصلون عليه في أوقات أخرى، كلها، أوقات العمل، فهو يكره من هذا الوقت ولكن. يهرب من الملذات المحسوسة ليفترض أنها لا شيء، كل شيء أو، والألم هو الخيار الأكبر، فإنه أيسر عليه، وما يتبعه يقدمون الألم ونحوه! لأن وسيلة الحقيقة المذكورة تطرد اللذة وتمنع الألم، فهي تقدم كما لو \ No newline at end of file diff --git a/src/content/ar/authors/-index.md b/src/content/ar/authors/-index.md new file mode 100644 index 0000000..8d66730 --- /dev/null +++ b/src/content/ar/authors/-index.md @@ -0,0 +1,5 @@ +--- +title: "المؤلفون" +meta_title: "" +description: "this is meta description" +--- diff --git a/src/content/ar/authors/john-doe.md b/src/content/ar/authors/john-doe.md new file mode 100644 index 0000000..5f0858a --- /dev/null +++ b/src/content/ar/authors/john-doe.md @@ -0,0 +1,20 @@ +--- +title: فلان الفلاني +email: johndoe@email.com +image: "/images/avatar.png" +description: this is meta description +social: + - name: github + icon: FaGithub + link: https://github.com + + - name: twitter + icon: FaTwitter + link: https://twitter.com + + - name: linkedin + icon: FaLinkedin + link: https://linkedin.com +--- + +lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostr navigation et dolore magna aliqua. diff --git a/src/content/ar/authors/sam-wilson.md b/src/content/ar/authors/sam-wilson.md new file mode 100644 index 0000000..722db33 --- /dev/null +++ b/src/content/ar/authors/sam-wilson.md @@ -0,0 +1,20 @@ +--- +title: سام ويلسون +email: samwilson@email.com +image: "/images/avatar.png" +description: this is meta description +social: + - name: github + icon: FaGithub + link: https://github.com + + - name: twitter + icon: FaTwitter + link: https://twitter.com + + - name: linkedin + icon: FaLinkedin + link: https://linkedin.com +--- + +lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostr navigation et dolore magna aliqua. diff --git a/src/content/ar/authors/william-jacob.md b/src/content/ar/authors/william-jacob.md new file mode 100644 index 0000000..9c06b41 --- /dev/null +++ b/src/content/ar/authors/william-jacob.md @@ -0,0 +1,20 @@ +--- +title: وليام جاكوب +email: williamjacob@email.com +image: "/images/avatar.png" +description: this is meta description +social: + - name: github + icon: FaGithub + link: https://github.com + + - name: twitter + icon: FaTwitter + link: https://twitter.com + + - name: linkedin + icon: FaLinkedin + link: https://linkedin.com +--- + +lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostr navigation et dolore magna aliqua. diff --git a/src/content/ar/blog/-index.md b/src/content/ar/blog/-index.md new file mode 100755 index 0000000..e69277c --- /dev/null +++ b/src/content/ar/blog/-index.md @@ -0,0 +1,5 @@ +--- +title: "منشورات المدونة" +meta_title: "" +description: "this is meta description" +--- diff --git a/src/content/ar/blog/post-1.md b/src/content/ar/blog/post-1.md new file mode 100755 index 0000000..0246e43 --- /dev/null +++ b/src/content/ar/blog/post-1.md @@ -0,0 +1,23 @@ +--- +title: "كيفية بناء تطبيق بالتكنولوجيا الحديثة" +meta_title: "" +description: "this is meta description" +date: 2022-04-04T05:00:00Z +image: "/images/image-placeholder.png" +categories: ["Application", "Data", "Arabic"] +author: "John Doe" +tags: ["nextjs", "tailwind"] +draft: false +--- + +لا داعي للقلق بشأن إنشاء rutrum على سبيل المثال، venenatis sollicitudin urna. Aliquam عصر فولوتبات. عدد صحيح الاتحاد الأوروبي ipsum sem. Ut bibendum lacus الدهليزي مكسيموس سوسكيبيت. السيرة الذاتية الرائعة nibh iaculis neque blandit euismod. + +Lorem ipsum dolor sit amet consectetur adipisicing elit. لا حاجة إلى إنشاء aperiam. Itaque eligendi natus aperiam؟ استثناءات طاردة للسلبية خيار التعجيل السريع هو أديبيسسي دولوريم أوت إيوس! + +## التصميم الإبداعي + +Nam ut rutrum ex, venenatis sollicitudin urna. Aliquam عصر فولوتبات. عدد صحيح الاتحاد الأوروبي ipsum sem. Ut bibendum lacus الدهليزي مكسيموس suscipit. السيرة الذاتية الرائعة nibh iaculis neque blandit euismod. + +> لوريم إيبسوم دولور الجلوس أميت كونسيكتور أديبيسينج إيليت. لا حاجة إلى إنشاء aperiam. Itaque eligendi natus aperiam؟ استثناءات طاردة للسلبية خيار التعجيل السريع هو أديبيسسي دولوريم أوت إيوس! + +Lorem ipsum dolor sit amet consectetur adipisicing elit. لا حاجة إلى إنشاء aperiam. Itaque eligendi natus aperiam؟ استثناءات طاردة للسلبية خيار التعجيل السريع هو أديبيسسي دولوريم أوت إيوس! diff --git a/src/content/blog/post-2.md b/src/content/ar/blog/post-2.md similarity index 100% rename from src/content/blog/post-2.md rename to src/content/ar/blog/post-2.md diff --git a/src/content/blog/post-3.md b/src/content/ar/blog/post-3.md similarity index 100% rename from src/content/blog/post-3.md rename to src/content/ar/blog/post-3.md diff --git a/src/content/blog/post-4.md b/src/content/ar/blog/post-4.md similarity index 100% rename from src/content/blog/post-4.md rename to src/content/ar/blog/post-4.md diff --git a/src/content/contact/-index.md b/src/content/ar/contact/-index.md similarity index 100% rename from src/content/contact/-index.md rename to src/content/ar/contact/-index.md diff --git a/src/content/ar/homepage/-index.md b/src/content/ar/homepage/-index.md new file mode 100755 index 0000000..e7c56e4 --- /dev/null +++ b/src/content/ar/homepage/-index.md @@ -0,0 +1,53 @@ +--- +# Banner +banner: + title: "القالب المبدئي المثالي الذي تحتاجه لبدء مشروعك الفلكي" + content: "Astroplate هو قالب بداية مجاني مصمم باستخدام Astro وTailwindCSS، وهو يوفر كل ما تحتاجه لبدء مشروع Astro الخاص بك وتوفير الوقت الثمين." + image: "/images/banner.png" + button: + enable: true + label: "Get Started For Free" + link: "https://github.com/zeon-studio/astroplate" + +# Features +features: + - title: "What's Included in Astroplate" + image: "/images/service-1.png" + content: "Astroplate is a comprehensive starter template that includes everything you need to get started with your Astro project. What's Included in Astroplate" + bulletpoints: + - "10+ Pre-build pages" + - "95+ Google Pagespeed Score" + - "Build with Astro and TailwindCSS for easy and customizable styling" + - "Fully responsive on all devices" + - "SEO-optimized for better search engine rankings" + - "**Open-source and free** for personal and commercial use" + button: + enable: false + label: "Get Started Now" + link: "#" + + - title: "Discover the Key Features Of Astro" + image: "/images/service-2.png" + content: "Astro is an all-in-one web framework for building fast, content-focused websites. It offers a range of exciting features for developers and website creators. Some of the key features are:" + bulletpoints: + - "Zero JS, by default: No JavaScript runtime overhead to slow you down." + - "Customizable: Tailwind, MDX, and 100+ other integrations to choose from." + - "UI-agnostic: Supports React, Preact, Svelte, Vue, Solid, Lit and more." + button: + enable: true + label: "Get Started Now" + link: "https://github.com/zeon-studio/astroplate" + + - title: "The Top Reasons to Choose Astro for Your Next Project" + image: "/images/service-3.png" + content: "With Astro, you can build modern and content-focused websites without sacrificing performance or ease of use." + bulletpoints: + - "Instantly load static sites for better user experience and SEO." + - "Intuitive syntax and support for popular frameworks make learning and using Astro a breeze." + - "Use any front-end library or framework, or build custom components, for any project size." + - "Built on cutting-edge technology to keep your projects up-to-date with the latest web standards." + button: + enable: false + label: "" + link: "" +--- diff --git a/src/content/ar/pages/elements.mdx b/src/content/ar/pages/elements.mdx new file mode 100755 index 0000000..0ff30a4 --- /dev/null +++ b/src/content/ar/pages/elements.mdx @@ -0,0 +1,255 @@ +--- +title: "عناصر" +meta_title: "" +description: "this is meta description" +draft: false +--- + +# عنوان 1 + +## العنوان 2 + +### العنوان 3 + +#### العنوان 4 + +##### العنوان 5 + +###### العنوان 6 + +--- + +### فقرة + +هل أتيت إلى هنا من أجل شيء محدد أم مجرد تقريع للرايكر بشكل عام؟ وبالانطلاق إلى أقصى سرعة ممكنة، ظهرت للحظة وكأنك في مكانين في الوقت نفسه. لدينا مخرب على متن الطائرة. نحن نعلم أنك تتعامل بالخام المسروق. لكني أريد أن أتحدث عن محاولة اغتيال الملازم وورف. هل يمكن لأي شخص البقاء على قيد الحياة داخل منطقة النقل العازلة لمدة 75 عامًا؟ قدر. إنه يحمي الحمقى والأطفال الصغار والسفن. + +هل أتيت إلى هنا من أجل شيء محدد أم مجرد تقريع عام للرايكر؟ وبالانطلاق إلى أقصى سرعة ممكنة، ظهرت للحظة وكأنك في مكانين في الوقت نفسه. لدينا مخرب على متن الطائرة. نحن نعلم أنك تتعامل بالخام المسروق. لكني أريد أن أتحدث عن محاولة اغتيال الملازم وورف. هل يمكن لأي شخص البقاء على قيد الحياة داخل منطقة النقل العازلة لمدة 75 عامًا؟ قدر. إنه يحمي الحمقى والأطفال الصغار والسفن. + +--- + +### توكيد + +1. هل أتيت إلى هنا من أجل شيء **خاص** أم مجرد عام + +2. هل أتيت إلى هنا من أجل شيء ما على وجه الخصوص + +3. _هل أتيت إلى هنا_ + +4. هل أتيت إلى هنا من أجل ** شيء ما ** على وجه الخصوص + +5. هل أتيت إلى هنا من أجل شيء محدد؟ + +6. هل أتيت إلى هنا من أجل شيء محدد؟ + +7. سيتم تحويل عناوين URL وعناوين URL الموجودة بين قوسين إلى روابط تلقائيًا. [http://www.example.com](http://www.example.com) أو + +8. [http://www.example.com](http://www.example.com) وأحيانًا example.com (ولكن ليس على Github، على سبيل المثال). + +--- + +### وصلة + +[أنا رابط ذو نمط مضمّن](https://www.google.com) + +[أنا رابط على شكل سطري يحمل عنوانًا](https://www.google.com "صفحة Google الرئيسية") + +[أنا رابط ذو نمط مرجعي] [نص مرجعي عشوائي غير حساس لحالة الأحرف] + +[أنا مرجع نسبي لملف مستودع](../blob/master/LICENSE) + +[يمكنك استخدام الأرقام لتعريفات الارتباط ذات النمط المرجعي] [1] + +أو اتركه فارغًا واستخدم [رابط النص نفسه]. + +example.com (ولكن ليس على Github، على سبيل المثال). + +بعض النص لإظهار أن الروابط المرجعية يمكن أن تتبع لاحقًا. + +[نص مرجعي عشوائي غير حساس لحالة الأحرف]: https://www.themefisher.com +[1]: https://gethugothemes.com +[رابط النص نفسه]: https://www.getjekyllthemes.com + +--- + +### Ordered List + +1. List item +2. List item +3. List item +4. List item +5. List item + +--- + +### Unordered List + +- List item +- List item +- List item +- List item +- List item + +--- + +### Code and Syntax Highlighting + +#### HTML + +```html +

+``` + +--- + +#### CSS + +```css +img { + vertical-align: middle; + border: 0; + max-width: 100%; + height: auto; +} +``` + +--- + +#### JavaScript + +```javascript +window.addEventListener("load", (e) => { + document.querySelector(".preloader").style.display = "none"; +}); +``` + +--- + +### Button + + + diff --git a/src/pages/index.astro b/src/pages/[...lang]/index.astro similarity index 71% rename from src/pages/index.astro rename to src/pages/[...lang]/index.astro index 19d3f99..07b1ab8 100755 --- a/src/pages/index.astro +++ b/src/pages/[...lang]/index.astro @@ -1,12 +1,16 @@ --- import ImageMod from "@/components/ImageMod.astro"; +import config from "@/config/config.json"; import Base from "@/layouts/Base.astro"; +import { getListPage } from "@/lib/contentParser.astro"; import { markdownify } from "@/lib/utils/textConverter"; import CallToAction from "@/partials/CallToAction.astro"; import Testimonial from "@/partials/Testimonial.astro"; import type { Button, Feature } from "@/types"; -import { getEntry } from "astro:content"; +import type { ContentEntryMap } from "astro:content"; +import { getCollection } from "astro:content"; import { FaCheck } from "react-icons/fa"; +const { defaultLang } = config.language; interface Homepage { banner: { @@ -18,10 +22,35 @@ interface Homepage { features: Feature[]; } -const homepage = await getEntry("homepage", "-index"); -const testimonial = await getEntry("sections", "testimonial"); -const call_to_action = await getEntry("sections", "call-to-action"); -const { banner, features }: Homepage = homepage.data; +export function getStaticPaths() { + const { supported } = config.language; + const paths = supported.map((lang) => ({ + params: { lang: lang || undefined }, + })); + return paths; +} + +const { lang } = Astro.params; +const homepage = await getListPage("homepage", lang as keyof ContentEntryMap); + +// const testimonial = await getEntry("sections", "testimonial"); +// const call_to_action = await getEntry("sections", "call-to-action"); +const { banner, features }: Homepage = homepage[0].data; + +const testimonial = await getCollection( + (lang as keyof ContentEntryMap) || defaultLang, + ({ id }) => { + return id.startsWith("sections/testimonial") && !id.endsWith("-index.md"); + } +); +const call_to_action = await getCollection( + (lang as keyof ContentEntryMap) || defaultLang, + ({ id }) => { + return ( + id.startsWith("sections/call-to-action") && !id.endsWith("-index.md") + ); + } +); --- @@ -109,6 +138,6 @@ const { banner, features }: Homepage = homepage.data; } - - + + diff --git a/src/pages/authors/index.astro b/src/pages/authors/index.astro deleted file mode 100755 index 8df557f..0000000 --- a/src/pages/authors/index.astro +++ /dev/null @@ -1,29 +0,0 @@ ---- -import AuthorCard from "@/components/AuthorCard.astro"; -import Base from "@/layouts/Base.astro"; -import { getSinglePage } from "@/lib/contentParser.astro"; -import PageHeader from "@/partials/PageHeader.astro"; -import { getEntry } from "astro:content"; - -const COLLECTION_FOLDER = "authors"; - -const authorIndex = await getEntry(COLLECTION_FOLDER, "-index"); -const authors = await getSinglePage(COLLECTION_FOLDER); ---- - - - -
-
-
- { - authors.map((author) => ( -
- -
- )) - } -
-
-
- diff --git a/src/pages/blog/[single].astro b/src/pages/blog/[single].astro deleted file mode 100755 index 984477b..0000000 --- a/src/pages/blog/[single].astro +++ /dev/null @@ -1,30 +0,0 @@ ---- -import Base from "@/layouts/Base.astro"; -import PostSingle from "@/layouts/PostSingle.astro"; -import { getSinglePage } from "@/lib/contentParser.astro"; - -export async function getStaticPaths() { - const BLOG_FOLDER = "blog"; - const posts = await getSinglePage(BLOG_FOLDER); - - const paths = posts.map((post) => ({ - params: { - single: post.slug, - }, - props: { post }, - })); - return paths; -} - -const { post } = Astro.props; -const { title, meta_title, description, image } = post.data; ---- - - - - diff --git a/src/pages/tags/[tag].astro b/src/pages/tags/[tag].astro deleted file mode 100755 index cd81405..0000000 --- a/src/pages/tags/[tag].astro +++ /dev/null @@ -1,45 +0,0 @@ ---- -import BlogCard from "@/components/BlogCard.astro"; -import Base from "@/layouts/Base.astro"; -import { getSinglePage } from "@/lib/contentParser.astro"; -import { getTaxonomy } from "@/lib/taxonomyParser.astro"; -import { sortByDate } from "@/lib/utils/sortFunctions"; -import taxonomyFilter from "@/lib/utils/taxonomyFilter"; -import PageHeader from "@/partials/PageHeader.astro"; - -export async function getStaticPaths() { - const BLOG_FOLDER = "blog"; - const tags = await getTaxonomy(BLOG_FOLDER, "tags"); - - return tags.map((tag) => { - return { - params: { tag }, - }; - }); -} - -const { tag } = Astro.params; - -// get posts by tag -const BLOG_FOLDER = "blog"; -const posts = await getSinglePage(BLOG_FOLDER); -const filterByTags = taxonomyFilter(posts, "tags", tag!); -const sortedPosts = sortByDate(filterByTags); ---- - - - -
-
-
- { - sortedPosts.map((post) => ( -
- -
- )) - } -
-
-
- diff --git a/src/pages/tags/index.astro b/src/pages/tags/index.astro deleted file mode 100755 index 0989c16..0000000 --- a/src/pages/tags/index.astro +++ /dev/null @@ -1,39 +0,0 @@ ---- -import Base from "@/layouts/Base.astro"; -import { getAllTaxonomy, getTaxonomy } from "@/lib/taxonomyParser.astro"; -import { humanize } from "@/lib/utils/textConverter"; -import PageHeader from "@/partials/PageHeader.astro"; - -const BLOG_FOLDER = "blog"; - -const tags = await getTaxonomy(BLOG_FOLDER, "tags"); -const allTags = await getAllTaxonomy(BLOG_FOLDER, "tags"); ---- - - - -
- -
- diff --git a/src/styles/base.scss b/src/styles/base.scss index 2fac7c2..b568330 100755 --- a/src/styles/base.scss +++ b/src/styles/base.scss @@ -3,7 +3,7 @@ html { } body { - @apply bg-body text-base dark:bg-darkmode-body font-primary font-normal leading-relaxed text-text dark:text-darkmode-text; + @apply bg-body dark:bg-darkmode-body font-primary font-normal leading-relaxed text-text dark:text-darkmode-text; } h1,