SiteWebAstrolabe/src/feed.njk
2024-11-21 12:57:18 +01:00

35 lines
1.3 KiB
Plaintext

---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"
}
}
---
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:base="{{ metadata.base | addPathPrefixToFullUrl }}" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ metadata.title }}</title>
<link>{{ metadata.base | addPathPrefixToFullUrl }}</link>
<atom:link href="{{ permalink | htmlBaseUrl(metadata.base) }}" rel="self" type="application/rss+xml" />
<description>{{ metadata.description }}</description>
<language>{{ metadata.language or page.lang }}</language>
{%- for post in collections.news %}
{%- set absolutePostUrl = post.url | htmlBaseUrl(metadata.base) %}
<item>
<title>{{ post.data.title }}</title>
<link>{{ absolutePostUrl }}</link>
<description>{{ post.data.description }}</description>
<pubDate>{{ post.date | dateToRfc822 }}</pubDate>
<category>{{ post.data.type }}</category>
<dc:creator>{{ post.data.author or metadata.author }}</dc:creator>
<guid>{{ absolutePostUrl }}</guid>
</item>
{%- endfor %}
</channel>
</rss>