From 9520f303ea6075bd5206c65e7bf9a7ddfd279c24 Mon Sep 17 00:00:00 2001 From: Nicolas Doby Date: Sun, 4 Dec 2022 20:14:28 +0100 Subject: [PATCH] feat: add a better integration of the authors --- eleventy.config.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/eleventy.config.js b/eleventy.config.js index 76e3cdf..d13827d 100644 --- a/eleventy.config.js +++ b/eleventy.config.js @@ -104,7 +104,10 @@ module.exports = function(eleventyConfig) { }); eleventyConfig.addFilter("readableAuthors", (authors) => { - return authors ? "par " + (authors || []).join(" & ") : ""; + if (authors.length > 1) { + return "par " + authors.slice(0, -1).join(", ") + " et " + authors.slice(-1); + } + return "par " + (authors || []); }); eleventyConfig.addFilter("noHome", elements => {