feat: add a better integration of the authors

pull/6/head
Nicolas Doby 2022-12-04 20:14:28 +01:00
parent 63aa82a960
commit 9520f303ea
1 changed files with 4 additions and 1 deletions

View File

@ -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 => {