From 0f6ebe1f034b225e83d33b546e312fb4ac1b44d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9l=C3=A8ne=20Jonin?= Date: Mon, 5 Feb 2024 16:10:08 +0100 Subject: [PATCH] Dynamically update cards on home page For sill random software and awesome random project --- _data/sill.js | 4 +-- _includes/components/card-custom-home.njk | 2 +- content/data/awesome.njk | 4 +++ content/data/sill.njk | 4 +++ content/fr/index.njk | 39 ++++++++++------------- public/js/home.js | 39 +++++++++++++++++++++++ 6 files changed, 67 insertions(+), 25 deletions(-) create mode 100644 content/data/awesome.njk create mode 100644 content/data/sill.njk create mode 100644 public/js/home.js diff --git a/_data/sill.js b/_data/sill.js index a9365a98..2ff16ed0 100644 --- a/_data/sill.js +++ b/_data/sill.js @@ -1,8 +1,8 @@ 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 + const URL = "https://code.gouv.fr/sill/api/sill.json"; // To use when SILL is up + // const URL = "https://code.gouv.fr/data/sill.json"; // Backup source let sill = await EleventyFetch(URL, { duration: "2w", diff --git a/_includes/components/card-custom-home.njk b/_includes/components/card-custom-home.njk index 28dfa5de..471a9e47 100644 --- a/_includes/components/card-custom-home.njk +++ b/_includes/components/card-custom-home.njk @@ -1,5 +1,5 @@ {% if not card %}{% set card = params %}{% endif %} -