diff --git a/.github/workflows/preproduction.yml b/.github/workflows/preproduction.yml index 958875de..be10ea5d 100644 --- a/.github/workflows/preproduction.yml +++ b/.github/workflows/preproduction.yml @@ -17,7 +17,7 @@ jobs: submodules: true - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 cache: 'npm' - name: Build with Eleventy run: | diff --git a/.github/workflows/production.yml b/.github/workflows/production.yml index c17a58ed..8f3fc3ce 100644 --- a/.github/workflows/production.yml +++ b/.github/workflows/production.yml @@ -17,7 +17,7 @@ jobs: submodules: true - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 cache: 'npm' - name: Build with Eleventy run: | diff --git a/_data/awesome b/_data/awesome index 0e5eb4eb..a5fe0938 160000 --- a/_data/awesome +++ b/_data/awesome @@ -1 +1 @@ -Subproject commit 0e5eb4ebe5018355fd878241d3b622d1b81389d8 +Subproject commit a5fe09385aa06f49883383aeee8f6c592a29cce3 diff --git a/_data/i18n/index.js b/_data/i18n/index.js index 5f2e284d..fa820a0b 100644 --- a/_data/i18n/index.js +++ b/_data/i18n/index.js @@ -20,5 +20,5 @@ const buildTranslations = () => { module.exports = { availableLang: langDirectories, - ...buildTranslations() + translations: buildTranslations() }; diff --git a/_data/sill.js b/_data/sill.js new file mode 100644 index 00000000..a9365a98 --- /dev/null +++ b/_data/sill.js @@ -0,0 +1,13 @@ +const EleventyFetch = require("@11ty/eleventy-fetch"); + +module.exports = async function () { + const URL = "https://code.gouv.fr/data/sill.json"; + // const URL = "https://code.gouv.fr/sill/api/sill.json"; // To use when SILL is up + + let sill = await EleventyFetch(URL, { + duration: "2w", + type: "json" + }); + + return sill; +}; \ No newline at end of file diff --git a/_includes/components/card-custom-home.njk b/_includes/components/card-custom-home.njk new file mode 100644 index 00000000..28dfa5de --- /dev/null +++ b/_includes/components/card-custom-home.njk @@ -0,0 +1,30 @@ +{% if not card %}{% set card = params %}{% endif %} + \ No newline at end of file diff --git a/_includes/components/card.njk b/_includes/components/card.njk index 66fa65b7..1bbf5265 100644 --- a/_includes/components/card.njk +++ b/_includes/components/card.njk @@ -1,5 +1,5 @@ {% if not card %}{% set card = params %}{% endif %} -
+
{% set cardUrl = card.url | locale_url or card.externalUrl %} @@ -37,20 +37,24 @@ {% endif %}
-
- {% if card.badges %} -
    - {% for badge in card.badges %} -
  • {{ badge }}

  • - {% endfor %} -
- {% endif %} - {% if card.image.path %} -
{% imageSync card.image.path, card.image.alt %}
- {% elif card.image.src %} -
- {{ card.image.alt }} -
- {% endif %} -
+ {% if card.badges or card.image %} +
+ {% if card.badges %} +
    + {% for badge in card.badges %} +
  • {{ badge }}

  • + {% endfor %} +
+ {% endif %} + {% if card.image %} + {% if card.image.path %} +
{% imageSync card.image.path, card.image.alt %}
+ {% elif card.image.src %} +
+ {{ card.image.alt }} +
+ {% endif %} + {% endif %} +
+ {% endif %}
\ No newline at end of file diff --git a/_includes/postslist.njk b/_includes/postslist.njk index cc65c611..5285a509 100644 --- a/_includes/postslist.njk +++ b/_includes/postslist.njk @@ -13,7 +13,7 @@ path: post.data.image.path | resolvePath(post), alt: post.data.image.alt }, - orientation: "horizontal" + addClass: "fr-card--horizontal-tier" }) }}
{% endall %} diff --git a/_includes/previousnextlinks.njk b/_includes/previousnextlinks.njk index 08e55973..af7ceb7a 100644 --- a/_includes/previousnextlinks.njk +++ b/_includes/previousnextlinks.njk @@ -1,3 +1,4 @@ +{% from "components/component.njk" import component with context %} {% set previousPost = currentPosts | filterCollectionLang | getPreviousCollectionItem %} {% set nextPost = currentPosts | filterCollectionLang | getNextCollectionItem %} {% if nextPost or previousPost %} @@ -6,34 +7,22 @@
{% if previousPost %}
- + {{ component("card", { + url: previousPost.url, + title: previousPost.data.title, + date: previousPost.date, + addClass: "fr-card--horizontal-tier fr-card--grey fr-card--no-border fr-card--sm" + }) }}
{% endif %} {% if nextPost %}
- + {{ component("card", { + url: nextPost.url, + title: nextPost.data.title, + date: nextPost.date, + addClass: "fr-card--horizontal-tier fr-card--grey fr-card--no-border fr-card--sm" + }) }}
{% endif %}
diff --git a/content/fr/blog/posts/de-la-transparence-a-lexplicabilite-automatisee-des-algorithmes/index.md b/content/fr/blog/posts/de-la-transparence-a-lexplicabilite-automatisee-des-algorithmes/index.md index 071e7e7a..3f0d68ac 100644 --- a/content/fr/blog/posts/de-la-transparence-a-lexplicabilite-automatisee-des-algorithmes/index.md +++ b/content/fr/blog/posts/de-la-transparence-a-lexplicabilite-automatisee-des-algorithmes/index.md @@ -6,7 +6,10 @@ image: path: ./illustration-explication-algorithmes.png alt: "Exemple d'interface pour expliquer un traitement algorithmique" hide: True -tags: explicabilité algorithmes transparence +tags: + - explicabilité + - algorithmes + - transparence --- *La transparence algorithmique ne se résume pas à la publication des codes sources. Comme le reflète la page que nous avons dédiée aux [outils aidant à expliquer les décisions administratives](https://code.gouv.fr/fr/explicabilite/), les façons de traduire du texte juridique en code source informatique sont variées. La mission logiciels libres accueille une entrée de blog invitée proposée par Denis Merigoux, Marie Alauzen, Justine Banuls, Louis Gesbert et Émile Rolley ; ils nous présentent un travail de recherche récent sur ces sujets. Les recommandations formulées dans cette entrée de blog appartiennent à son auteur.* diff --git a/content/fr/bluehats/bsoc/2022/promotion.njk b/content/fr/bluehats/bsoc/2022/promotion.njk index f0c5ebd0..3da07928 100644 --- a/content/fr/bluehats/bsoc/2022/promotion.njk +++ b/content/fr/bluehats/bsoc/2022/promotion.njk @@ -22,7 +22,7 @@ permalink: /fr/bluehats/bsoc-promotion-2022/ path: person.imagePath, alt: person.name }, - orientation: "horizontal" + orientation: "fr-card--horizontal-tier" }) }} {% endall %} diff --git a/content/fr/index.11tydata.js b/content/fr/index.11tydata.js index 52e927f2..e0b1dcd4 100644 --- a/content/fr/index.11tydata.js +++ b/content/fr/index.11tydata.js @@ -2,13 +2,13 @@ module.exports = { actions: [ { url: "/fr/utiliser/", - title: "Utiliser", + title: "Pour l'administration", description: "Mieux connaître, utiliser et concevoir les logiciels libres et les communs numériques.", }, { url: false, externalUrl: "https://code.gouv.fr/public/", - title: "Publier", + title: "Par les administrations", description: "Développer et accompagner l’ouverture et la libération des codes sources de l'administration.", }, { diff --git a/content/fr/index.njk b/content/fr/index.njk index c2d36b16..66bb7f93 100644 --- a/content/fr/index.njk +++ b/content/fr/index.njk @@ -23,6 +23,53 @@ eleventyNavigation:
+ {% from "components/component.njk" import component with context %} +
+
+

Des logiciels libres pour et par les administrations

+
+
+
+
+ {% set randomSoftware = sill | random %} + {% if randomSoftware.logoUrl %} + {% set randomSoftwareImage = { + src: randomSoftware.logoUrl, + alt: "Logo de " + randomSoftware.n + } %} + {% endif %} + {{ component("card-custom-home", { + url: false, + externalUrl: "https://code.gouv.fr/sill/" + randomSoftware.n, + title: randomSoftware.n, + image: randomSoftwareImage, + detail: "Un logiciel au hasard" + }) }} +
+
+ {% set randomSourceCode = awesome.dist | values | random %} + {% if randomSourceCode.logo %} + {% set randomSourceCodeImage = { + src: randomSourceCode.logo, + alt: "Logo de " + randomSourceCode.name + } %} + {% endif %} + {{ component("card-custom-home", { + url: "/awesome/" | locale_url, + title: randomSourceCode.name, + image: randomSourceCodeImage, + detail: "Un projet au hasard" + }) }} +
+
+ {% set latestBlueHatsPost = collections.bluehats_posts | filterCollectionLang | last %} + {{ component("card-custom-home", { + url: latestBlueHatsPost.url, + title: latestBlueHatsPost.data.title, + announcement: "La dernière actualité BlueHats" + }) }} +
+
{% for tile in actions %}
diff --git a/eleventy.config.js b/eleventy.config.js index 4dfc34eb..c7079ccc 100644 --- a/eleventy.config.js +++ b/eleventy.config.js @@ -15,7 +15,7 @@ const pluginCalendar = require("@codegouvfr/eleventy-plugin-calendar"); const customMarkdownContainers = require("./markdown-custom-containers"); -const translations = require("./_data/i18n"); +const {translations} = require("./_data/i18n"); module.exports = function (eleventyConfig) { // Copy the contents of the `public` folder to the output folder @@ -147,9 +147,7 @@ module.exports = function (eleventyConfig) { return collection.find(post => post.fileSlug === slug); }); - eleventyConfig.addFilter("stripTags", str => { - return (str || "").replace(/<[^>]*>/g, ''); - }); + eleventyConfig.addFilter("values", object => Object.values(object)); // Customize Markdown library settings: eleventyConfig.amendLibrary("md", mdLib => { diff --git a/package-lock.json b/package-lock.json index 1ac22e4c..d1811e87 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "license": "MIT", "devDependencies": { "@11ty/eleventy": "^2.0.1", + "@11ty/eleventy-fetch": "^4.0.0", "@11ty/eleventy-img": "^3.1.8", "@11ty/eleventy-navigation": "^0.3.5", "@11ty/eleventy-plugin-bundle": "^1.0.5", diff --git a/package.json b/package.json index a29dbf84..7f5bd838 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "homepage": "https://code.gouv.fr/", "devDependencies": { "@11ty/eleventy": "^2.0.1", + "@11ty/eleventy-fetch": "^4.0.0", "@11ty/eleventy-img": "^3.1.8", "@11ty/eleventy-navigation": "^0.3.5", "@11ty/eleventy-plugin-bundle": "^1.0.5", diff --git a/public/css/index.css b/public/css/index.css index 456a1824..4fb6725b 100644 --- a/public/css/index.css +++ b/public/css/index.css @@ -152,3 +152,14 @@ div.fr-callout__text p { .text-center { text-align: center; } + +.custom-card__img { + height: 100%; + display: flex; + justify-content: center; + align-items: center; +} + +.custom-card__img img { + width: 50%; +}