Skip to content

Commit

Permalink
feat: les notes apparaissent le la plus récente à la plus ancienne
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-bouvier committed Oct 11, 2024
1 parent 7f8608d commit 553d1d6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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"],
Expand All @@ -91,7 +97,7 @@ export default function (eleventyConfig) {
sizes: `100vw`,
},

sharpOptions:{
sharpOptions: {
animated: true,
}
})
Expand Down
2 changes: 1 addition & 1 deletion notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}

Expand Down

0 comments on commit 553d1d6

Please sign in to comment.