diff --git a/.idea/vcs.xml b/.idea/vcs.xml index 35eb1ddf..94a25f7f 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/_data/awesome b/_data/awesome deleted file mode 160000 index a5fe0938..00000000 --- a/_data/awesome +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a5fe09385aa06f49883383aeee8f6c592a29cce3 diff --git a/_data/awesome.js b/_data/awesome.js new file mode 100644 index 00000000..fa1224e3 --- /dev/null +++ b/_data/awesome.js @@ -0,0 +1,12 @@ +const EleventyFetch = require("@11ty/eleventy-fetch"); + +module.exports = async function () { + const URL = "https://code.gouv.fr/data/awesome-codegouvfr.json"; + + let awesome = await EleventyFetch(URL, { + duration: "2w", + type: "json" + }); + + return awesome; +}; \ No newline at end of file diff --git a/content/fr/awesome/index.njk b/content/fr/awesome/index.njk index 447a0756..9c8de393 100644 --- a/content/fr/awesome/index.njk +++ b/content/fr/awesome/index.njk @@ -14,7 +14,7 @@ eleventyNavigation: }) }}
- {% asyncAll filename, project in awesome.dist %} + {% asyncAll project in awesome %}
{{ component("card", { url: false, diff --git a/content/fr/index.njk b/content/fr/index.njk index 66bb7f93..d0316f17 100644 --- a/content/fr/index.njk +++ b/content/fr/index.njk @@ -47,7 +47,7 @@ eleventyNavigation: }) }}
- {% set randomSourceCode = awesome.dist | values | random %} + {% set randomSourceCode = awesome | random %} {% if randomSourceCode.logo %} {% set randomSourceCodeImage = { src: randomSourceCode.logo, diff --git a/eleventy.config.js b/eleventy.config.js index c7079ccc..9e12bb7d 100644 --- a/eleventy.config.js +++ b/eleventy.config.js @@ -147,8 +147,6 @@ module.exports = function (eleventyConfig) { return collection.find(post => post.fileSlug === slug); }); - eleventyConfig.addFilter("values", object => Object.values(object)); - // Customize Markdown library settings: eleventyConfig.amendLibrary("md", mdLib => { mdLib.use(markdownItAnchor, {