-
-
Notifications
You must be signed in to change notification settings - Fork 578
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(fr): add components/cards
, components/link-cards
& components/card-grids
#2346
Merged
HiDeoo
merged 5 commits into
withastro:main
from
HiDeoo:hd-i18n-fr-0-28-0-components-cards
Sep 19, 2024
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
d43e523
i18n(fr): add `components/cards`
HiDeoo 35b499b
i18n(fr): add `components/link-cards`
HiDeoo 44bc64f
i18n(fr): add `components/card-grids`
HiDeoo c1a05f1
i18n(fr): apply suggestion
HiDeoo 8613798
Merge branch 'main' into hd-i18n-fr-0-28-0-components-cards
HiDeoo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,181 @@ | ||
--- | ||
title: Grilles de cartes | ||
description: Apprenez à regrouper plusieurs cartes dans une grille dans Starlight. | ||
sidebar: | ||
order: 4 | ||
--- | ||
|
||
import { Card, CardGrid, LinkCard } from '@astrojs/starlight/components'; | ||
|
||
Pour regrouper plusieurs composants [`<Card>`](/fr/components/cards/) ou [`<LinkCard>`](/fr/components/link-cards/) dans une grille, utilisez le composant `<CardGrid>`. | ||
|
||
import Preview from '~/components/component-preview.astro'; | ||
|
||
<Preview> | ||
|
||
<CardGrid slot="preview"> | ||
<Card title="Étoiles" icon="star"> | ||
Sirius, Véga, Bételgeuse | ||
</Card> | ||
<Card title="Lunes" icon="moon"> | ||
Io, Europe, Ganymède | ||
</Card> | ||
</CardGrid> | ||
|
||
</Preview> | ||
|
||
## Import | ||
|
||
```tsx | ||
import { CardGrid } from '@astrojs/starlight/components'; | ||
``` | ||
|
||
## Utilisation | ||
|
||
### Grouper des cartes | ||
|
||
Affichez plusieurs composants [`<Card>`](/fr/components/cards/) côte à côte lorsqu'il y a suffisamment d'espace en les regroupant à l'aide du composant `<CardGrid>`. | ||
|
||
<Preview> | ||
|
||
```mdx {3,10} | ||
import { Card, CardGrid } from '@astrojs/starlight/components'; | ||
|
||
<CardGrid> | ||
<Card title="Regardez-ça" icon="open-book"> | ||
Contenu intéressant que vous souhaitez mettre en évidence. | ||
</Card> | ||
<Card title="Et autre chose" icon="information"> | ||
Plus d'informations que vous souhaitez partager. | ||
</Card> | ||
</CardGrid> | ||
``` | ||
|
||
<Fragment slot="markdoc"> | ||
|
||
```markdoc {1,9} | ||
{% cardgrid %} | ||
{% card title="Regardez-ça" icon="open-book" %} | ||
Contenu intéressant que vous souhaitez mettre en évidence. | ||
{% /card %} | ||
|
||
{% card title="Et autre chose" icon="information" %} | ||
Plus d'informations que vous souhaitez partager. | ||
{% /card %} | ||
{% /cardgrid %} | ||
``` | ||
|
||
</Fragment> | ||
|
||
<CardGrid slot="preview"> | ||
<Card title="Regardez-ça" icon="open-book"> | ||
Contenu intéressant que vous souhaitez mettre en évidence. | ||
</Card> | ||
<Card title="Et autre chose" icon="information"> | ||
Plus d'informations que vous souhaitez partager. | ||
</Card> | ||
</CardGrid> | ||
|
||
</Preview> | ||
|
||
### Grouper des cartes de liaison | ||
|
||
Affichez plusieurs composants [`<LinkCard>`](/fr/components/link-cards/) côte à côte lorsqu'il y a suffisamment d'espace en les regroupant à l'aide du composant `<CardGrid>`. | ||
|
||
<Preview> | ||
|
||
```mdx {3,9} | ||
import { LinkCard, CardGrid } from '@astrojs/starlight/components'; | ||
|
||
<CardGrid> | ||
<LinkCard | ||
title="Création de contenu en Markdown" | ||
href="/fr/guides/authoring-content/" | ||
/> | ||
<LinkCard title="Composants" href="/fr/components/using-components/" /> | ||
</CardGrid> | ||
``` | ||
|
||
<Fragment slot="markdoc"> | ||
|
||
```markdoc {1,7} | ||
{% cardgrid %} | ||
{% linkcard | ||
title="Création de contenu en Markdown" | ||
href="/fr/guides/authoring-content/" /%} | ||
|
||
{% linkcard title="Composants" href="/fr/components/using-components/" /%} | ||
{% /cardgrid %} | ||
``` | ||
|
||
</Fragment> | ||
|
||
<CardGrid slot="preview"> | ||
<LinkCard | ||
title="Création de contenu en Markdown" | ||
href="/fr/guides/authoring-content/" | ||
/> | ||
<LinkCard title="Composants" href="/fr/components/using-components/" /> | ||
</CardGrid> | ||
|
||
</Preview> | ||
|
||
### Décaler des cartes | ||
|
||
Décalez la deuxième colonne de la grille verticalement pour ajouter un intérêt visuel en ajoutant l'attribut [`stagger`](#stagger) au composant `<CardGrid>`. | ||
|
||
Cet attribut est utile sur votre page d'accueil pour afficher les principales fonctionnalités de votre projet. | ||
|
||
<Preview> | ||
|
||
```mdx "stagger" | ||
import { Card, CardGrid } from '@astrojs/starlight/components'; | ||
|
||
<CardGrid stagger> | ||
<Card title="Regardez-ça" icon="open-book"> | ||
Contenu intéressant que vous souhaitez mettre en évidence. | ||
</Card> | ||
<Card title="Et autre chose" icon="information"> | ||
Plus d'informations que vous souhaitez partager. | ||
</Card> | ||
</CardGrid> | ||
``` | ||
|
||
<Fragment slot="markdoc"> | ||
|
||
```markdoc "stagger=true" | ||
{% cardgrid stagger=true %} | ||
{% card title="Regardez-ça" icon="open-book" %} | ||
Contenu intéressant que vous souhaitez mettre en évidence. | ||
{% /card %} | ||
|
||
{% card title="Et autre chose" icon="information" %} | ||
Plus d'informations que vous souhaitez partager. | ||
{% /card %} | ||
{% /cardgrid %} | ||
``` | ||
|
||
</Fragment> | ||
|
||
<CardGrid slot="preview" stagger> | ||
<Card title="Regardez-ça" icon="open-book"> | ||
Contenu intéressant que vous souhaitez mettre en évidence. | ||
</Card> | ||
<Card title="Et autre chose" icon="information"> | ||
Plus d'informations que vous souhaitez partager. | ||
</Card> | ||
</CardGrid> | ||
|
||
</Preview> | ||
|
||
## Props de `<CardGrid>` | ||
|
||
**Implémentation :** [`CardGrid.astro`](https://github.com/withastro/starlight/blob/main/packages/starlight/user-components/CardGrid.astro) | ||
|
||
Le composant `<CardGrid>` accepte les props suivantes : | ||
|
||
### `stagger` | ||
|
||
**Type :** `boolean` | ||
|
||
Définit si les cartes de la grille doivent être décalées ou non. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
--- | ||
title: Cartes | ||
description: Apprenez à utiliser des cartes dans Starlight pour afficher du contenu dans un cadre. | ||
sidebar: | ||
order: 2 | ||
--- | ||
|
||
import { Card } from '@astrojs/starlight/components'; | ||
|
||
Pour afficher du contenu dans un cadre correspondant aux styles de Starlight, utilisez le composant `<Card>`. | ||
|
||
import Preview from '~/components/component-preview.astro'; | ||
|
||
<Preview> | ||
|
||
<Card slot="preview" title="Lunes" icon="moon"> | ||
Io, Europe, Ganymède | ||
</Card> | ||
|
||
</Preview> | ||
|
||
## Import | ||
|
||
```tsx | ||
import { Card } from '@astrojs/starlight/components'; | ||
``` | ||
|
||
## Utilisation | ||
|
||
Affichez une carte en utilisant le composant `<Card>` et fournissez un titre à la carte en utilisant la propriété [`title`](#title). | ||
|
||
<Preview> | ||
|
||
```mdx | ||
import { Card } from '@astrojs/starlight/components'; | ||
|
||
<Card title="Regardez-ça"> | ||
Contenu intéressant que vous souhaitez mettre en évidence. | ||
</Card> | ||
``` | ||
|
||
<Fragment slot="markdoc"> | ||
|
||
```markdoc | ||
{% card title="Regardez-ça" %} | ||
Contenu intéressant que vous souhaitez mettre en évidence. | ||
{% /card %} | ||
``` | ||
|
||
</Fragment> | ||
|
||
<Card slot="preview" title="Regardez-ça"> | ||
Contenu intéressant que vous souhaitez mettre en évidence. | ||
</Card> | ||
|
||
</Preview> | ||
|
||
### Ajouter des icônes aux cartes | ||
|
||
Incluez une icône dans une carte en utilisant l'attribut [`icon`](#icon) défini avec le nom de [l'une des icônes intégrées à Starlight](/fr/reference/icons/#toutes-les-icônes). | ||
|
||
<Preview> | ||
|
||
```mdx 'icon="star"' | ||
import { Card } from '@astrojs/starlight/components'; | ||
|
||
<Card title="Étoiles" icon="star"> | ||
Sirius, Véga, Bételgeuse | ||
</Card> | ||
``` | ||
|
||
<Fragment slot="markdoc"> | ||
|
||
```markdoc 'icon="star"' | ||
{% card title="Étoiles" icon="star" %} | ||
Sirius, Véga, Bételgeuse | ||
{% /card %} | ||
``` | ||
|
||
</Fragment> | ||
|
||
<Card slot="preview" title="Étoiles" icon="star"> | ||
Sirius, Véga, Bételgeuse | ||
</Card> | ||
|
||
</Preview> | ||
|
||
### Grouper des cartes | ||
|
||
Affichez plusieurs cartes côte à côte lorsqu'il y a suffisamment d'espace en les regroupant à l'aide du composant [`<CardGrid>`](/fr/components/card-grids/). | ||
Consultez le guide [« Grouper des cartes »](/fr/components/card-grids/#grouper-des-cartes) pour un exemple. | ||
|
||
## Props de `<Card>` | ||
|
||
**Implémentation :** [`Card.astro`](https://github.com/withastro/starlight/blob/main/packages/starlight/user-components/Card.astro) | ||
|
||
Le composant `<Card>` accepte les props suivantes : | ||
|
||
### `title` | ||
|
||
**Obligatoire** | ||
**Type :** `string` | ||
|
||
Le titre de la carte à afficher. | ||
|
||
### `icon` | ||
|
||
**Type :** `string` | ||
|
||
Une carte peut inclure un attribut `icon` défini avec le nom de [l'une des icônes intégrées à Starlight](/fr/reference/icons/#toutes-les-icônes). |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Title slightly tweaked from the English version to avoid some wrapping.