feat(rss): add news collection to feed.xml
This commit is contained in:
parent
6d97a59e51
commit
1157585904
@ -13,6 +13,7 @@
|
|||||||
|
|
||||||
<title>{{ pageTitle }}</title>
|
<title>{{ pageTitle }}</title>
|
||||||
<link rel="canonical" href="{{ currentUrl }}" />
|
<link rel="canonical" href="{{ currentUrl }}" />
|
||||||
|
<link rel="alternate" type="application/rss+xml" title="Astrolabe CAE's RSS Feed" href="/feed.xml" />
|
||||||
|
|
||||||
<meta property="og:site_name" content="{{ siteTitle }}" />
|
<meta property="og:site_name" content="{{ siteTitle }}" />
|
||||||
<meta property="og:title" content="{{ pageTitle }}" />
|
<meta property="og:title" content="{{ pageTitle }}" />
|
||||||
|
35
src/feed.njk
Normal file
35
src/feed.njk
Normal file
@ -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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
---
|
||||||
|
<?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.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>
|
Loading…
Reference in New Issue
Block a user