Skip to content

Commit

Permalink
Merge branch 'main' into production
Browse files Browse the repository at this point in the history
  • Loading branch information
bzg committed Jan 14, 2025
2 parents 59c5804 + d859582 commit f658795
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 0 deletions.
12 changes: 12 additions & 0 deletions _data/formations.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const EleventyFetch = require("@11ty/eleventy-fetch");

module.exports = async function () {
const URL = "https://code.gouv.fr/data/formations-logiciels-libres.json";

let formations = await EleventyFetch(URL, {
duration: "2w",
type: "json"
});

return formations;
};
48 changes: 48 additions & 0 deletions _includes/components/card_formation.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{% if not card %}{% set card = params %}{% endif %}
<div class="fr-card{% if not card.externalUrl %} fr-enlarge-link{% endif %} {{ card.addClass }}">
<div class="fr-card__body">
<div class="fr-card__content">
<h3 class="fr-card__title">
<a href="{{ card.externalUrl }}">
{{ card.title }}
</a>
</h3>
<p class="fr-card__desc">{{ card.description }}</p>
<div class="fr-card__start">
<p><a href="mailto:{{ card.email }}">{{ card.email }}</a></p>
</div>
<div class="fr-card__end">
<h6>Formations</h6>
<ul>
{% for f in card.formations %}
{% if loop.index0 < 3 %}
<li>{{ f }}</li>
{% endif %}
{% endfor %}
<li>...</li>
</ul>
<p class="fr-card__detail">{{ card.detailEnd }}</p>
</div>
</div>
</div>
{% if card.badges or card.image %}
<div class="fr-card__header">
{% if card.badges %}
<ul class="fr-badges-group">
{% for badge in card.badges %}
<li><p class="fr-badge fr-badge--green-emeraude">{{ badge }}</p></li>
{% endfor %}
</ul>
{% endif %}
{% if card.image %}
{% if card.image.path %}
<div class="fr-card__img">{% imageSync card.image.path, card.image.alt %}</div>
{% elif card.image.src %}
<div class="fr-card__img">
<img class="fr-responsive-img fr-responsive-img--1x1" src="{{ card.image.src }}" alt="{{ card.image.alt }}">
</div>
{% endif %}
{% endif %}
</div>
{% endif %}
</div>
30 changes: 30 additions & 0 deletions content/fr/formations/index.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
title: "Offre de formations logiciels libres"
description: Liste des formations logiciels libres par des organismes français
layout: layouts/page.njk
eleventyNavigation:
key: "Formations logiciels libres"
parent: Ressources
order: 5
---

{% from "components/component.njk" import component with context %}
{{ component("callout", {
title: "Formations logiciels libres",
description: '<a class="fr-link fr-text--lead" href="mailto:[email protected]">Sollicitez-nous pour être référencés</a>.' | safe
}) }}
<div class="fr-my-6w">
<div class="fr-grid-row fr-grid-row--gutters">
{% asyncAll formation in formations %}
<div class="fr-col-12 fr-col-md-3">
{{ component("card_formation", {
externalUrl: formation.site_web,
title: formation.organisme,
description: formation.description,
formations: formation.formations,
email: formation.courriel
}) }}
</div>
{% endall %}
</div>
</div>

0 comments on commit f658795

Please sign in to comment.