Skip to content
Snippets Groups Projects
Commit ca330692 authored by Régis Witz's avatar Régis Witz
Browse files

:globe_with_meridians: traduction/adaptation de l'article sur les bannières

parent 42cd6251
Branches
No related merge requests found
...@@ -74,8 +74,8 @@ pygmentCodeFences = true ...@@ -74,8 +74,8 @@ pygmentCodeFences = true
[[menu.main]] [[menu.main]]
parent = "samples" parent = "samples"
name = "Big Image" name = "Bannières"
url = "post/2017-03-07-bigimg-sample" url = "post/bannieres"
weight = 1 weight = 1
[[menu.main]] [[menu.main]]
......
---
title: Big Image Sample
subtitle: Using Multiple Images
date: 2017-03-07
tags: ["example", "bigimg"]
bigimg: [{src: "img/triangle.jpg"}, {src: "img/sphere.jpg"}, {src: "img/hexagon.jpg"}]
---
The image banners at the top of the page are refered to as "bigimg" in this theme. They are optional, and one more more can be specified. If more than one is specified, the images rotate every 10 seconds. In the front matter, bigimgs are specified using an array of hashes.
<!--more-->
A single bigimg can be specified in the front matter by the following YAML:
```
bigimg: [{src: "/img/triangle.jpg", desc: "Triangle"}]
```
Multiple bigimgs can be specified in the front matter by the following YAML:
```
bigimg: [{src: "/img/triangle.jpg", desc: "Triangle"},
{src: "/img/sphere.jpg", desc: "Sphere"},
{src: "/img/hexagon.jpg", desc: "Hexagon"}]
```
Also note that the description field is optional, and images could instead be specified by:
```
bigimg: [{src: "/img/triangle.jpg"},
{src: "/img/sphere.jpg"},
{src: "/img/hexagon.jpg"}]
```
The above YAML array of hashes were written in "flow" style. However when generating a new page or post with `hugo new post/mypost.md`, hugo may interpret the archetype for bigimg in the default YAML style. Defining multiple bigimg's complete with descriptions in this style would be specified by:
```
bigimg:
- {src: "/img/triangle.jpg", desc: "Triangle"}
- {src: "/img/sphere.jpg", desc: "Sphere"}
- {src: "/img/hexagon.jpg", desc: "Hexagon"}
```
Additional information can be found [in this YAML tutorial](https://rhnh.net/2011/01/31/yaml-tutorial/).
---
title: Bannières
subtitle: En utilisant une ou plusieurs images
date: 2021-03-09
tags: ["example", "bigimg"]
bigimg: [{src: "img/triangle.jpg"}, {src: "img/sphere.jpg"}, {src: "img/hexagon.jpg"}]
---
La bannière en haut de cette page est dénommée « _bigimg_ ».
Elle est déclarée dans l'en-tête.
Elle est optionnelle, et peut comporter une image ou davantage.
Si plusieurs images sont déclarées dans une bannière, elles défilent toutes les 10 secondes.
<!--more-->
Une seule image est déclarée en tant que bannière de la manière suivante :
```
bigimg: [{src: "img/triangle.jpg"}]
```
Il est possible d'assortir une description à chaque image :
```
bigimg: [{src: "img/triangle.jpg", desc: "Triangle"}]
```
Plusieurs images peuvent être déclarées dans l'en tête.
Cela se fait de la manière suivante :
```
bigimg: [{src: "img/triangle.jpg", desc: "Triangle"},
{src: "img/sphere.jpg", desc: "Sphere"},
{src: "img/hexagon.jpg", desc: "Hexagon"}]
```
Les descriptions étant optionnelles, on peut aussi déclarer les images de cette manière :
```
bigimg: [{src: "img/triangle.jpg"},
{src: "img/sphere.jpg"},
{src: "img/hexagon.jpg"}]
```
Alternativement, la syntaxe suivante est aussi admise :
```
bigimg:
- {src: "img/triangle.jpg", desc: "Triangle"}
- {src: "img/sphere.jpg", desc: "Sphere"}
- {src: "img/hexagon.jpg", desc: "Hexagon"}
```
À titre d'information, la syntaxe spécifique utilisé dans l'en-tête de chaque fichier se nomme [YAML](https://fr.wikipedia.org/wiki/YAML).
Elle est spécifique aux fichiers d'en-tête et de configuration.
Elle est à distinguer de la syntaxe markdown [abordée précédemment]({{< ref "syntaxe-markdown.md" >}}).
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment