From 115758590498bbdb1ab8fceb1d02d4e6cef33efe Mon Sep 17 00:00:00 2001 From: Florian Michaut Date: Tue, 19 Nov 2024 18:29:07 +0100 Subject: [PATCH] feat(rss): add news collection to feed.xml --- src/_includes/partials/global/meta-info.njk | 1 + src/feed.njk | 35 +++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 src/feed.njk diff --git a/src/_includes/partials/global/meta-info.njk b/src/_includes/partials/global/meta-info.njk index f0ced13..1742f0a 100644 --- a/src/_includes/partials/global/meta-info.njk +++ b/src/_includes/partials/global/meta-info.njk @@ -13,6 +13,7 @@ {{ pageTitle }} + diff --git a/src/feed.njk b/src/feed.njk new file mode 100644 index 0000000..1aaa370 --- /dev/null +++ b/src/feed.njk @@ -0,0 +1,35 @@ +---json +{ + "permalink": "feed.xml", + "eleventyExcludeFromCollections": true, + "metadata": { + "title": "Actualité d'Astrolabe", + "description": "Retrouvez nos dernières actualités", + "language": "fr", + "base": "https://www.astrolabe.coop/", + "author": "Astrolabe CAE" + } +} +--- + + + + {{ metadata.title }} + {{ metadata.base | addPathPrefixToFullUrl }} + + {{ metadata.description }} + {{ metadata.language or page.lang }} + {%- for post in collections.news %} + {%- set absolutePostUrl = post.url | htmlBaseUrl(metadata.base) %} + + {{ post.data.title }} + {{ absolutePostUrl }} + {{ post.description }} + {{ post.date | dateToRfc822 }} + {{ post.data.type }} + {{ post.data.author or metadata.author }} + {{ absolutePostUrl }} + + {%- endfor %} + + \ No newline at end of file