Sorted!

Sorted!

Jan 13th, 2024

Got the front page to only show the most recent content by adding the following to my .eleventy.js file

  eleventyConfig.addCollection("front", function(collectionAPI) {
    return collectionAPI.getFilteredByTag("posts").sort(function(a, b) {
        return b.date - a.date;
      }).slice(0, 5);
    });

and then the loop in index.njk is


  {% for post in collections.front %} 
    {% include "homeplate.njk" %} 
  {% endfor %} 

links: how to escape code in markdown

mood: why is it still raining and so windy?