Skip to content

Commit f658795

Browse files
committed
Merge branch 'main' into production
2 parents 59c5804 + d859582 commit f658795

File tree

3 files changed

+90
-0
lines changed

3 files changed

+90
-0
lines changed

_data/formations.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
const EleventyFetch = require("@11ty/eleventy-fetch");
2+
3+
module.exports = async function () {
4+
const URL = "https://code.gouv.fr/data/formations-logiciels-libres.json";
5+
6+
let formations = await EleventyFetch(URL, {
7+
duration: "2w",
8+
type: "json"
9+
});
10+
11+
return formations;
12+
};
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{% if not card %}{% set card = params %}{% endif %}
2+
<div class="fr-card{% if not card.externalUrl %} fr-enlarge-link{% endif %} {{ card.addClass }}">
3+
<div class="fr-card__body">
4+
<div class="fr-card__content">
5+
<h3 class="fr-card__title">
6+
<a href="{{ card.externalUrl }}">
7+
{{ card.title }}
8+
</a>
9+
</h3>
10+
<p class="fr-card__desc">{{ card.description }}</p>
11+
<div class="fr-card__start">
12+
<p><a href="mailto:{{ card.email }}">{{ card.email }}</a></p>
13+
</div>
14+
<div class="fr-card__end">
15+
<h6>Formations</h6>
16+
<ul>
17+
{% for f in card.formations %}
18+
{% if loop.index0 < 3 %}
19+
<li>{{ f }}</li>
20+
{% endif %}
21+
{% endfor %}
22+
<li>...</li>
23+
</ul>
24+
<p class="fr-card__detail">{{ card.detailEnd }}</p>
25+
</div>
26+
</div>
27+
</div>
28+
{% if card.badges or card.image %}
29+
<div class="fr-card__header">
30+
{% if card.badges %}
31+
<ul class="fr-badges-group">
32+
{% for badge in card.badges %}
33+
<li><p class="fr-badge fr-badge--green-emeraude">{{ badge }}</p></li>
34+
{% endfor %}
35+
</ul>
36+
{% endif %}
37+
{% if card.image %}
38+
{% if card.image.path %}
39+
<div class="fr-card__img">{% imageSync card.image.path, card.image.alt %}</div>
40+
{% elif card.image.src %}
41+
<div class="fr-card__img">
42+
<img class="fr-responsive-img fr-responsive-img--1x1" src="{{ card.image.src }}" alt="{{ card.image.alt }}">
43+
</div>
44+
{% endif %}
45+
{% endif %}
46+
</div>
47+
{% endif %}
48+
</div>

content/fr/formations/index.njk

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
title: "Offre de formations logiciels libres"
3+
description: Liste des formations logiciels libres par des organismes français
4+
layout: layouts/page.njk
5+
eleventyNavigation:
6+
key: "Formations logiciels libres"
7+
parent: Ressources
8+
order: 5
9+
---
10+
11+
{% from "components/component.njk" import component with context %}
12+
{{ component("callout", {
13+
title: "Formations logiciels libres",
14+
description: '<a class="fr-link fr-text--lead" href="mailto:[email protected]">Sollicitez-nous pour être référencés</a>.' | safe
15+
}) }}
16+
<div class="fr-my-6w">
17+
<div class="fr-grid-row fr-grid-row--gutters">
18+
{% asyncAll formation in formations %}
19+
<div class="fr-col-12 fr-col-md-3">
20+
{{ component("card_formation", {
21+
externalUrl: formation.site_web,
22+
title: formation.organisme,
23+
description: formation.description,
24+
formations: formation.formations,
25+
email: formation.courriel
26+
}) }}
27+
</div>
28+
{% endall %}
29+
</div>
30+
</div>

0 commit comments

Comments
 (0)