Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n(ar): Add missing astro-pages.mdx #8021

Merged
Merged
Changes from 1 commit
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
8040b5b
i18n(ar): Add missing `astro-pages.mdx` for Arabic
wpplumber Apr 26, 2024
ce17886
i18n(fr) Update french translation for `integrations-guide.mdx` (#8032)
McFlyPartages Apr 26, 2024
c5aa17b
i18n(fr) Update French Translation for `deploy.mdx` (#8027)
McFlyPartages Apr 26, 2024
eb1f97f
i18n(fr) Update french translation for `wordpress.mdx` (#8025)
McFlyPartages Apr 26, 2024
8a1ace6
i18n(fr) Update french translation for `google-firebase.mdx` (#8024)
McFlyPartages Apr 26, 2024
596bdbc
i18n (fr) Update french translation for `authentication.mdx` (#8023)
McFlyPartages Apr 26, 2024
209cfce
i18n[FR] Update French translation for `content.mdx` file (#8022)
McFlyPartages Apr 26, 2024
5326ad1
i18n(fr) Update French translation for `rss.mdx` (#8034)
McFlyPartages Apr 26, 2024
a7db4ed
i18n(fr) Update french translation for `microsoft-azure.mdx` (#8029)
McFlyPartages Apr 26, 2024
7a317bb
i18n(fr) Update french translation for `content-collections.mdx` (#8026)
McFlyPartages Apr 26, 2024
84497d5
i18n(fr) Update french translation `images.mdx` (#8031)
McFlyPartages Apr 26, 2024
af07661
i18n(ru): translate guides/internationalization.mdx (#8003)
dragomano Apr 26, 2024
b4a1fe9
i18n(es): Making toolbar apps (#8017)
helmerdavila Apr 27, 2024
54b04af
i18n(fr) Update french translation for `aws.mdx` and `content.mdx` (#…
McFlyPartages Apr 27, 2024
8a07517
i18n(fr) Update french translation for `fonts.mdx` (#8030)
McFlyPartages Apr 27, 2024
93d62cb
i18n(fr) Update French translation `markdown-content.mdx` (#8033)
McFlyPartages Apr 27, 2024
d170f48
i18n(ko-KR): update `cli-reference.mdx`, `dev-toolbar-app-reference.m…
jsparkdev Apr 29, 2024
c0a63a8
i18n(ar): Update `getting-started.mdx` (#8013)
wpplumber Apr 29, 2024
3dc142a
i18n(ar): Update `contribute.mdx` (#8005)
wpplumber Apr 29, 2024
9628693
i18n(zh-cn): Update `rss.mdx` (#8006)
huyikai Apr 29, 2024
8925589
i18n(pt-BR): Update `editor-setup.mdx` translation (#8039)
Egpereira Apr 29, 2024
277d589
i18n(pt-BR): Update `aliases.mdx` translation (#8040)
Egpereira Apr 29, 2024
a7480ab
i18n(pt-BR): Update `authentication.mdx` translation (#8041)
Egpereira Apr 29, 2024
c155074
i18n(pt-BR): Update `configuring-astro.mdx` translation (#8043)
Egpereira Apr 29, 2024
84427fb
i18n(pt-BR): Update `client-side-scripts.mdx` translation (#8044)
Egpereira Apr 29, 2024
f4ee362
i18n(pt-BR): Update `deploy.mdx` translation (#8045)
Egpereira Apr 29, 2024
ca2d5ac
i18n(pt-BR): Update `dev-toolbar.mdx` translation (#8046)
Egpereira Apr 29, 2024
ec3025a
i18n(pt-BR): Add new `making-toolbar-apps.mdx` translation (#8047)
Egpereira Apr 29, 2024
528c762
i18n(zh-cn): remove duplicated translation in rss.mdx (#8054)
CaptainOfPhB Apr 30, 2024
3728883
i18n(zh-cn): Updated content related to the release of minor version …
huyikai Apr 30, 2024
d9fc5ab
i18n(es): Remove duplicated altText (#8055)
baumannzone Apr 30, 2024
82d2c9b
i18n(es): update `fonts` (#8052)
dreyfus92 Apr 30, 2024
b6a814d
i18n(es): Translate internationalization.mdx (#7985)
ansango Apr 30, 2024
76ae5b6
i18n(es): update `authentication` (#8048)
dreyfus92 Apr 30, 2024
3b0df4c
i18n(es): update `dev-toolbar` (#8051)
dreyfus92 Apr 30, 2024
87570d0
i18n(es): update `microsoft-azure` (#8049)
dreyfus92 Apr 30, 2024
270a6b3
Fix double/triple click selection issues on headings (#8015)
HiDeoo May 1, 2024
58e8856
Add info to SSR page on using Astro.response (#8011)
ascorbic May 1, 2024
46a5d41
Enforce __session name for cookie (#8014)
leoxs22 May 1, 2024
15a5f11
Register Button name (#8129)
hatkyinc2 May 1, 2024
d7a2e59
i18n(ko-KR): update `google-firebase.mdx` (#8140)
jsparkdev May 2, 2024
e83462e
i18n(ko-KR): update `supabase.mdx` (#8141)
jsparkdev May 2, 2024
3203f93
i18n(ko-KR): update `astro-glob-outside.mdx` (#8144)
jsparkdev May 2, 2024
3f4fdd5
i18n(ko-KR): update `server-side-rendering.mdx` (#8142)
jsparkdev May 2, 2024
1cd6903
Remove unnecessary character from integrations-reference.mdx (#8062)
Egpereira May 2, 2024
855efc9
Add Steps component to `cosmic.mdx` (#8082)
Egpereira May 2, 2024
6b5d2d6
Eduardo `<Steps>` up! (#8167)
yanthomasdev May 2, 2024
6f133ed
i18n(pt-BR): Update `fonts.mdx` translation (#8057)
Egpereira May 2, 2024
7052fdd
i18n(pt-BR): Update `integrations-reference.mdx` translation (#8061)
Egpereira May 2, 2024
cddc9d4
i18n(pt-BR): Update `cli-reference.mdx` translation (#8060)
Egpereira May 2, 2024
2660339
[i18nIgnore] Update directives-reference.mdx/added a comma (#8169)
JusticeMatthew May 2, 2024
a124d31
Add hashnode cms guide (#7374)
Adammatthiesen May 3, 2024
53d653f
Set docgen files to read-only (#8131)
natemoo-re May 3, 2024
c6e4b8a
[ci] format
sarah11918 May 3, 2024
ca51de3
Improve nodes description in React integrations docs (#8038)
oscarvz May 3, 2024
c93e309
[pull request template] Reminds new feature PRs to include `<Since>` …
sarah11918 May 3, 2024
ed29097
Fix typo mentioned by @X7md.
wpplumber May 4, 2024
ae47044
Merge branch 'main' into missing/arabic-docs-astro-pages
yanthomasdev May 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
175 changes: 175 additions & 0 deletions src/content/docs/ar/basics/astro-pages.mdx
@@ -0,0 +1,175 @@
---
title: الصفحاتات
wpplumber marked this conversation as resolved.
Show resolved Hide resolved
description: مقدمة في صفحات أسترو
i18nReady: true
---

import ReadMore from '~/components/ReadMore.astro';
import Since from '~/components/Since.astro'

**الصفحاتات** هي الملفات التي تعيش في `src/pages/` من مشروع أسترو الخاص بك. إنهم مسؤولون عن التعامل مع توجيه وتحميل البيانات والتخطيط العام للصفحة لكل صفحة في موقع الويب الخاص بك.
wpplumber marked this conversation as resolved.
Show resolved Hide resolved

## ملفات الصفحات المدعومة

يدعم أسترو أنواع الملفات التالية في المجلد `src/pages/`:
- [`astro.`](#astro-pages)
- [`md.`](#markdownmdx-pages)
- `mdx.` (مع [MDX التكامل المثبت](/ar/guides/integrations-guide/mdx/#installation))
- [`html.`](#html-pages)
- `js` / `.ts.` (ك [النهايات](/ar/guides/endpoints/))

## التوجيه القائم على الملف

يستفيد أسترو من استراتيجية توجيه تسمى **التوجيه المستند إلى الملف**. كل ملف في `src/pages/` الخاص بك يصبح نقطة نهاية على موقعك بناءً على مسار الملف الخاص به.

يمكن لملف واحد أيضًا إنشاء صفحات متعددة باستخدام [التوجيه الديناميكي](/ar/guides/routing/#dynamic-routes). يتيح لك ذلك إنشاء صفحات حتى لو كان المحتوى الخاص بك موجودًا خارج الدليل `/pages/` الخاص، كما هو الحال في [جمع المحتوى](/ar/guides/content-collections/) أو [CMS](/ar/guides/cms/).

<ReadMore>اقرأ المزيد عن [التوجيه في أسترو](/ar/guides/routing/).</ReadMore>

### الربط بين الصفحات

اكتب HTML القياسي [عناصر `<a>` ](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a) في صفحات أسترو الخاصة بك للربط بصفحات أخرى على موقعك. استخدم **مسار عنوان URL المتعلق بنطاقك الجذر** كرابط خاص بك، وليس مسار ملف نسبي.

على سبيل المثال، لربط `/https://example.com/authors/sonali` من أي صفحة أخرى `example.com`:

```astro title="src/pages/index.astro"
Read more <a href="/authors/sonali/">about Sonali</a>.
```

## صفحات استرو

تستخدم صفحات استرو `astro.` امتداد الملف ودعم نفس الميزات مثل [مكونات استرو](/ar/basics/astro-components/).

```astro title="src/pages/index.astro"
---
---
<html lang="en">
<head>
<title>My Homepage</title>
</head>
<body>
<h1>Welcome to my website!</h1>
</body>
</html>
```

يجب أن تنتج الصفحة مستند HTML كاملاً. إذا لم يتم تضمينه بشكل صريح، فسيضيف استرو الإعلان الضروري `<!DOCTYPE html>` ومحتوى `<head>` إلى أي مكون `astro.` موجود داخل `src/pages/` بشكل افتراضي. يمكنك إلغاء الاشتراك في هذا السلوك على أساس كل مكون عن طريق وضع علامة عليه كصفحة [جزئية](#page-partials).

لتجنب تكرار نفس عناصر HTML في كل صفحة، يمكنك نقل العناصر `<head>` و`<body>` الشائعة إلى [مكونات التخطيط](/ar/basics/layouts/) الخاصة بك. يمكنك استخدام أكبر عدد ممكن أو قليل من مكونات التخطيط كما تريد.

```astro {3} /</?MySiteLayout>/
---
// src/pages/index.astro
import MySiteLayout from '../layouts/MySiteLayout.astro';
---
<MySiteLayout>
<p>My page content, wrapped in a layout!</p>
</MySiteLayout>
```

<ReadMore>اقرأ المزيد عن [مكونات التخطيط](/ar/basics/layouts/) في استرو.</ReadMore>

## صفحات ماركداون/MDX

يعامل استرو أيضًا أي ماركداون (`md.`) الملفات الموجودة داخل `src/pages/` كصفحات في موقع الويب النهائي الخاص بك. إذا كان [ التكامل MDX مثبتًا لديك](/ar/guides/integrations-guide/mdx/#installation)، فإنه يتعامل أيضًا مع ملفات MDX بنفس الطريقة. يتم استخدامها بشكل شائع للصفحات ذات النصوص الثقيلة مثل منشورات المدونات والوثائق.

[مجموعات من محتوى صفحة ماركداون أو MDX](/ar/guides/content-collections/) في `src/content/` يمكن استخدامها لـ [إنشاء الصفحات ديناميكيًا](/ar/guides/routing/#dynamic-routes).

تعد تخطيطات الصفحة مفيدة بشكل خاص لـ [ملفات ماركداون](#markdownmdx-pages). يمكن لملفات ماركداون استخدام خاصية الواجهة الأمامية الخاصة `layout` لتحديد [مكون التخطيط](/ar/basics/layouts/) الذي سيغلف محتوى ماركداون الخاص بها في مستند صفحة `<html>...</html>` كامل .

```md {3}
---
# Example: src/pages/page.md
layout: '../layouts/MySiteLayout.astro'
title: 'My Markdown page'
---
# Title

This is my page, written in **Markdown.**
```

<ReadMore>اقرأ المزيد عن [ماركداون](/ar/guides/markdown-content/) في استرو.</ReadMore>

## صفحات HTML

يمكن وضع الملفات ذات امتداد الملف `html.` في الدليل `src/pages/` واستخدامها مباشرة كصفحات على موقعك. لاحظ أن بعض ميزات استرو الرئيسية غير مدعومة في [مكونات HTML](/ar/basics/astro-components/#html-components).

## صفحة خطأ 404 المخصصة

بالنسبة لصفحة خطأ 404 مخصصة، يمكنك إنشاء ملف `404.astro` أو `404.md` في `/src/pages`.

سيتم إنشاء هذا في صفحة `404.html`. معظم [خدمات النشر](/ar/guides/deploy/) ستجدها وتستخدمها.

## أجزاء الصفحة

<p><Since v="3.4.0" /></p>

:::caution
تهدف أجزاء الصفحة إلى استخدامها مع مكتبة الواجهة الأمامية، مثل [htmx](https://htmx.org/) أو [Unpoly](https://unpoly.com/). يمكنك أيضًا استخدامها إذا كنت مرتاحًا لكتابة JavaScript للواجهة الأمامية منخفضة المستوى. ولهذا السبب فهي ميزة متقدمة.

بالإضافة إلى ذلك، لا ينبغي استخدام الأجزاء إذا كان المكون يحتوي على أنماط أو نصوص برمجية محددة النطاق، حيث سيتم تجريد هذه العناصر من مخرجات HTML. إذا كنت بحاجة إلى أنماط محددة، فمن الأفضل استخدام صفحات عادية وغير جزئية إلى جانب مكتبة الواجهة الأمامية التي تعرف كيفية دمج المحتويات في الرأس.
:::

الأجزاء الجزئية هي مكونات صفحة موجودة ضمن `src/pages/` وليس المقصود منها عرضها كصفحات كاملة.

مثل المكونات الموجودة خارج هذا المجلد، لا تتضمن هذه الملفات تلقائيًا إعلان `<!DOCTYPE html>` ولا أي محتوى `<head>` مثل الأنماط والبرامج النصية المحددة النطاق.

ومع ذلك، ونظرًا لوجودها في الدليل `src/pages/` الخاص، فإن HTML الذي تم إنشاؤه متاح على عنوان URL المطابق لمسار الملف الخاص به. يسمح هذا لمكتبة العرض (مثل htmx وStimulus وjQuery) بالوصول إليها على العميل وتحميل أقسام HTML ديناميكيًا على الصفحة دون تحديث المتصفح أو التنقل في الصفحة.

توفر الأجزاء الجزئية، عند دمجها مع مكتبة العرض، بديلاً لـ [جزر استرو](/ar/concepts/islands/) وعلامات [`<script>`](/ar/guides/client-side-scripts/) للبناء المحتوى الديناميكي في استرو.
wpplumber marked this conversation as resolved.
Show resolved Hide resolved

يمكن وضع علامة على ملفات الصفحات التي يمكنها تصدير قيمة (مثل `astro` ، .`mdx`.) كأجزاء جزئية.

قم بتكوين ملف داخل الدليل `src/pages/` ليكون جزئيًا عن طريق إضافة التصدير التالي:

```astro title="src/pages/partial.astro" ins={2}
---
export const partial = true;
---

<li>I'm a partial!</li>
```

يجب أن يكون `export const partial` قابلاً للتعريف بشكل ثابت. يمكن أن يكون لها قيمة:

- المنطق __`true`__.
- متغير بيئة يستخدم import.meta.env مثل `import.meta.env.USE_PARTIALS`.

### باستخدام مع مكتبة ما

تُستخدم الأجزاء لتحديث قسم من الصفحة ديناميكيًا باستخدام مكتبة مثل [htmx](https://htmx.org/).

يوضح المثال التالي سمة `hx-post` التي تم تعيينها على عنوان URL الجزئي. سيتم استخدام المحتوى من الصفحة الجزئية لتحديث عنصر HTML المستهدف في هذه الصفحة.

```astro title="src/pages/index.astro" 'hx-post="/partials/clicked/"'
<html>
<head>
<title>My page</title>
<script src="https://unpkg.com/htmx.org@1.9.6"
integrity="sha384-FhXw7b6AlE/jyjlZH5iHa/tTe9EpJ1Y55RjcgPbjeWMskSxZt1v9qkxLJWNJaGni"
crossorigin="anonymous"></script>
</head>
</html>
<section>
<div id="parent-div">Target here</div>

<button hx-post="/partials/clicked/"
hx-trigger="click"
hx-target="#parent-div"
hx-swap="innerHTML"
>
Click Me!
</button>
</section>
```

يجب أن يكون الجزء `astro.` موجودًا في مسار الملف المقابل، ويتضمن تصديرًا يحدد الصفحة على أنها جزئية:

```astro title="src/pages/partials/clicked.astro" {2}
---
export const partial = true;
---
<div>I was clicked!</div>
```

راجع [وثائق htmx](https://htmx.org/docs/) لمزيد من التفاصيل حول استخدام htmx.