From 553d1d627b89a139189f5c9c85824b64d0be6bce Mon Sep 17 00:00:00 2001 From: Marc Bouvier Date: Fri, 11 Oct 2024 22:21:10 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20les=20notes=20apparaissent=20le=20la=20?= =?UTF-8?q?plus=20r=C3=A9cente=20=C3=A0=20la=20plus=20ancienne?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eleventy.js | 10 ++++++++-- notes.md | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.eleventy.js b/.eleventy.js index 920abb8..6509875 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -40,6 +40,12 @@ export default function (eleventyConfig) { }); + eleventyConfig.addCollection("allNotesFromRecentToOlder", function (collectionApi) { + let all = collectionApi.getFilteredByTag("notes"); + return all.sort((a, b) => b.date - a.date) + + }); + // Copy static styles as is eleventyConfig.addPassthroughCopy("public/css"); @@ -79,7 +85,7 @@ export default function (eleventyConfig) { extensions: "html", // output image formats - formats: ["webp", "jpeg", "png","auto"], + formats: ["webp", "jpeg", "png", "auto"], // output image widths widths: ["320", "640", "800", "1024", "auto"], @@ -91,7 +97,7 @@ export default function (eleventyConfig) { sizes: `100vw`, }, - sharpOptions:{ + sharpOptions: { animated: true, } }) diff --git a/notes.md b/notes.md index 0abe99e..3a3bd79 100644 --- a/notes.md +++ b/notes.md @@ -5,7 +5,7 @@ title: Notes Cette page est une collection de pensée courtes et spontanées qui n’a pas sa place dans [un article de blog complet](/blog). -{% for note in collections.notes %} +{% for note in collections.allNotesFromRecentToOlder %} - {{ note.data.date | toLocaleStringFr }} - [{{ note.data.title }}]({{note.url}}) {% endfor %}