From ca330692e833b4c932727bacac175156e6d933a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Witz?= <regis.witz@free.fr> Date: Wed, 2 Mar 2022 18:47:54 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=90=20traduction/adaptation=20de=20l'a?= =?UTF-8?q?rticle=20sur=20les=20banni=C3=A8res?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.toml | 4 +- content/post/2017-03-07-bigimg-sample.md | 40 ------------------- content/post/bannieres.md | 51 ++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 42 deletions(-) delete mode 100644 content/post/2017-03-07-bigimg-sample.md create mode 100644 content/post/bannieres.md diff --git a/config.toml b/config.toml index e1b56a2..d748a83 100644 --- a/config.toml +++ b/config.toml @@ -74,8 +74,8 @@ pygmentCodeFences = true [[menu.main]] parent = "samples" - name = "Big Image" - url = "post/2017-03-07-bigimg-sample" + name = "Bannières" + url = "post/bannieres" weight = 1 [[menu.main]] diff --git a/content/post/2017-03-07-bigimg-sample.md b/content/post/2017-03-07-bigimg-sample.md deleted file mode 100644 index a4f3e64..0000000 --- a/content/post/2017-03-07-bigimg-sample.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -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/). diff --git a/content/post/bannieres.md b/content/post/bannieres.md new file mode 100644 index 0000000..4dda00a --- /dev/null +++ b/content/post/bannieres.md @@ -0,0 +1,51 @@ +--- +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" >}}). -- GitLab