From 57e1a3d2622d1281eedabb81ef49eec6fdde8b4f Mon Sep 17 00:00:00 2001 From: Zach Leatherman Date: Mon, 15 Aug 2022 15:00:08 -0500 Subject: [PATCH] Show day on post page --- .eleventy.js | 4 ++-- _includes/postslist.njk | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.eleventy.js b/.eleventy.js index e8040ab..548fa97 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -27,8 +27,8 @@ module.exports = function(eleventyConfig) { errorMode: "allow-fallback", }); - eleventyConfig.addFilter("readableDate", dateObj => { - return DateTime.fromJSDate(dateObj, {zone: 'utc'}).toFormat("LLLL yyyy"); + eleventyConfig.addFilter("readableDate", (dateObj, format = "dd LLLL yyyy") => { + return DateTime.fromJSDate(dateObj, {zone: 'utc'}).toFormat(format); }); // https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#valid-date-string diff --git a/_includes/postslist.njk b/_includes/postslist.njk index 84219af..dd8c686 100644 --- a/_includes/postslist.njk +++ b/_includes/postslist.njk @@ -2,7 +2,7 @@ {% for post in postslist | reverse %}
  • {% if post.data.title %}{{ post.data.title }}{% else %}{{ post.url }}{% endif %} - +
  • {% endfor %}