Skip to content

Commit d44808e

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents c5d663a + e3b1c83 commit d44808e

File tree

5 files changed

+90
-32
lines changed

5 files changed

+90
-32
lines changed

_includes/components/accordionsgroup.njk

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
{% if not accordionItems %}{% set accordionItems = params.items %}{% endif %}
2+
3+
{% set groupId = nanoid() %}
4+
25
<div class="fr-accordions-group">
36
{% for accordionItem in accordionItems %}
47
<section class="fr-accordion">
58
<h3 class="fr-accordion__title">
6-
<button class="fr-accordion__btn" aria-expanded="false" aria-controls="accordion-{{ loop.index }}">
9+
<button class="fr-accordion__btn" aria-expanded="false" aria-controls="accordion-{{ groupId }}-{{ loop.index }}">
710
{{ accordionItem.title }}
811
</button>
912
</h3>
10-
<div class="fr-collapse" id="accordion-{{ loop.index }}">
13+
<div class="fr-collapse" id="accordion-{{ groupId }}-{{ loop.index }}">
1114
{{ accordionItem.content | safe }}
1215
</div>
1316
</section>

_includes/components/download.njk

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{% if not download %}{% set download = params %}{% endif %}
2+
{% if download.type == "card" %}
3+
<div class="fr-card fr-enlarge-link fr-card--download">
4+
<div class="fr-card__body">
5+
<div class="fr-card__content">
6+
<h3 class="fr-card__title">
7+
<a download href="{{ download.href }}">
8+
{{ download.title }}
9+
</a>
10+
</h3>
11+
{% if download.description %}
12+
<p class="fr-card__desc">{{ download.description }}</p>
13+
{% endif %}
14+
<div class="fr-card__end">
15+
<p class="fr-card__detail">{{ download.detail }}</p>
16+
</div>
17+
</div>
18+
</div>
19+
</div>
20+
{% elif download.type == "tile" %}
21+
<div class="fr-tile fr-tile--download fr-enlarge-link" id="tile-6735">
22+
<div class="fr-tile__body">
23+
<div class="fr-tile__content">
24+
<h4 class="fr-tile__title">
25+
<a href="{{ download.href }}" download>{{ download.title }}</a>
26+
</h4>
27+
<p class="fr-tile__desc">{{ download.description }}</p>
28+
<p class="fr-tile__detail">{{ download.detail }}</p>
29+
</div>
30+
</div>
31+
{% if download.pictogram %}
32+
<div class="fr-tile__header">
33+
<div class="fr-tile__pictogram">
34+
{% set pictogramUrl = "/artwork/pictograms/" + download.pictogram %}
35+
<svg aria-hidden="true" class="fr-artwork" viewBox="0 0 80 80" width="80px" height="80px">
36+
<use class="fr-artwork-decorative" href="{{ pictogramUrl | htmlBaseUrl }}#artwork-decorative"></use>
37+
<use class="fr-artwork-minor" href="{{ pictogramUrl | htmlBaseUrl }}#artwork-minor"></use>
38+
<use class="fr-artwork-major" href="{{ pictogramUrl | htmlBaseUrl }}#artwork-major"></use>
39+
</svg>
40+
</div>
41+
</div>
42+
{% endif %}
43+
</div>
44+
{% else %}
45+
<p>
46+
<a class="fr-link fr-link--download" download href="{{ download.href }}">
47+
{{ download.title }} <span class="fr-link__detail">{{ download.detail }}</span>
48+
</a>
49+
</p>
50+
{% endif %}

eleventy.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
const {DateTime} = require("luxon");
2+
const {nanoid} = require ("nanoid");
3+
24
const yaml = require("js-yaml");
5+
36
const markdownItAnchor = require("markdown-it-anchor");
47
const markdownItAttrs = require("markdown-it-attrs");
58
const markdownItContainer = require("markdown-it-container");
@@ -200,6 +203,8 @@ module.exports = function (eleventyConfig) {
200203
lstripBlocks: true,
201204
});
202205

206+
eleventyConfig.addNunjucksGlobal("nanoid", () => nanoid());
207+
203208
// Features to make your build faster (when you need them)
204209

205210
// If your passthrough copy gets heavy and cumbersome, add this line

package-lock.json

Lines changed: 29 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"@11ty/eleventy-plugin-bundle": "^1.0.5",
3434
"@11ty/eleventy-plugin-rss": "^1.2.0",
3535
"@11ty/eleventy-plugin-syntaxhighlight": "^5.0.0",
36-
"@codegouvfr/eleventy-plugin-calendar": "^3.0.4",
36+
"@codegouvfr/eleventy-plugin-calendar": "^3.0.5",
3737
"@codegouvfr/eleventy-plugin-i18n": "^0.1.3",
3838
"@gouvfr/dsfr": "^1.11.0",
3939
"ics": "^3.2.0",

0 commit comments

Comments
 (0)