You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/DEVELOPMENT.md
+54-1Lines changed: 54 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -254,6 +254,32 @@ To enable the simple TOC on a specific page, add the following to the front matt
254
254
255
255
This configuration will automatically generate a "On this page" section at the beginning of the content, listing the specified headings based on the toc or tocSimple setting.
256
256
257
+
## Download Component
258
+
259
+
The `hasDocument` frontmatter key allows you to include a downloadable document component on your page. This component provides information about the file, including its size, type, and filename.
260
+
261
+
The logic for this component is located in the following file: `src/_includes/partials/download.njk`.
262
+
263
+
To enable the download component on a page, include the `hasDocument` object in the frontmatter with the following keys:
264
+
265
+
-`filename`: The name of the file to be downloaded, including the extension. Example: `"example_document.docx"`. Documents should be put in `src/_docs/`.
266
+
-`sizeNumber`: The file size as a number. Example: `563`.
267
+
-`sizeUnit`: The unit for the file size. Acceptable values are case-insensitive:
268
+
- For English: `KB`, `MB`
269
+
- For French: `ko`, `Mo`
270
+
-`type`: (Optional) The type of document, such as `word` or `pdf`. If not specified, it defaults to the generic file type.
271
+
272
+
**Example Frontmatter:**
273
+
274
+
```yaml
275
+
hasDocument:
276
+
filename: "example_document.docx"
277
+
sizeNumber: 563
278
+
sizeUnit: KB
279
+
type: word
280
+
```
281
+
282
+
The file size and unit will automatically adapt to the current language (`locale`) set for the page.
257
283
______________________
258
284
259
285
<div lang="fr">
@@ -308,7 +334,7 @@ Une fois que vous avez rencontré [les conditions préalables](#Exigences), suiv
5. Récupérez toutes les dernières modifications. Cela fera en sorte que votre instance locale soit au courant de toutes les modifications récentes apportées à l'upstream du projet, mais rien ne sera mis à jour dans votre code.
337
+
5. Récupérez toutes les dernières modifications. Cela fera en sorte que votre instance locale soit au courant de toutes les modifications récentes apportées à l'upstream du projet, mais rien ne sera mis à jour dans votre code.
312
338
313
339
`git fetch --all`
314
340
@@ -507,4 +533,31 @@ Pour activer le TOC simple sur une page spécifique, ajoutez ce qui suit dans le
507
533
508
534
Cette configuration générera automatiquement une section "Sur cette page" au début du contenu, listant les titres spécifiés en fonction du paramètre `toc` ou `tocSimple`.
509
535
536
+
## Composant de téléchargement
537
+
538
+
La clé `hasDocument` dans le front matter vous permet d'ajouter un composant de document téléchargeable sur votre page. Ce composant fournit des informations sur le fichier, y compris sa taille, son type et son nom.
539
+
540
+
La logique de ce composant se trouve dans le fichier suivant : `src/_includes/partials/download.njk`.
541
+
542
+
Pour activer le composant de téléchargement sur une page, incluez l'objet `hasDocument` dans le frontmatter avec les clés suivantes :
543
+
544
+
- `filename` : Le nom du fichier à télécharger, y compris l'extension. Exemple : `"example_document.docx"`. Les documents doivent être placés dans `src/_docs/`.
545
+
- `sizeNumber` : La taille du fichier en tant que nombre. Exemple : `563`.
546
+
- `sizeUnit` : L'unité de la taille du fichier. Les valeurs acceptables ne tiennent pas compte de la casse :
547
+
- Pour l'anglais : `KB`, `MB`
548
+
- Pour le français : `ko`, `Mo`
549
+
- `type` : (Optionnel) Le type de document, tel que `word` ou `pdf`. Si ce n'est pas spécifié, il sera défini par défaut sur le type de fichier générique.
550
+
551
+
**Exemple de front matter :**
552
+
553
+
```yaml
554
+
hasDocument:
555
+
filename: "example_document.docx"
556
+
sizeNumber: 563
557
+
sizeUnit: KB
558
+
type: word
559
+
```
560
+
561
+
La taille et l'unité du fichier s'adapteront automatiquement à la langue actuelle (`locale`) définie pour la page.
0 commit comments