From bdf18a5fdf9aafe9d1bc57af6229e2ed0c2d7972 Mon Sep 17 00:00:00 2001 From: Nicolas Doby Date: Thu, 27 Oct 2022 11:22:17 +0200 Subject: [PATCH] feat: add authors --- eleventy.config.js | 4 ++++ src/_components/postslist.njk | 2 +- src/_layouts/post.njk | 4 +++- src/_pages/blog/exemple.md | 3 ++- src/_pages/blog/exemple_2.md | 6 ++++-- src/_pages/blog/exemple_3.md | 6 ++++-- src/_pages/index.njk | 2 +- src/assets/css/index.scss | 20 +++++++++++++++----- 8 files changed, 34 insertions(+), 13 deletions(-) diff --git a/eleventy.config.js b/eleventy.config.js index 4eaaa0e..f73c405 100644 --- a/eleventy.config.js +++ b/eleventy.config.js @@ -80,6 +80,10 @@ module.exports = function(eleventyConfig) { return (tags || []).filter(tag => ["all", "nav", "post", "posts"].indexOf(tag) === -1); }); + eleventyConfig.addFilter("readableAuthors", (authors) => { + return authors ? "par " + (authors || []).join(" & ") : ""; + }); + // Customize Markdown library and settings: eleventyConfig.amendLibrary("md", mdLib => { mdLib.use(markdownItAnchor, { diff --git a/src/_components/postslist.njk b/src/_components/postslist.njk index f3c064a..c74fb1a 100644 --- a/src/_components/postslist.njk +++ b/src/_components/postslist.njk @@ -5,7 +5,7 @@ {% if post.data.title %}{{ post.data.title }}{% else %}{{ post.url }}{% endif %}