website: add atom feeds for blogs (#2233)

* website: add atom feeds for blogs

* update front-matter

* website: add atom and rss feeds for blogs

* include full blog content

---------

Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
This commit is contained in:
M Sarmad Qadeer
2023-04-24 23:31:59 +05:00
committed by GitHub
parent f4b852d2dd
commit 9fa93e40cb
4 changed files with 77 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
---
permalink: feed.atom
eleventyExcludeFromCollections: true
metadata:
title: SimpleX Chat Blog
subtitle: It allows you to stay up to date with the latest Blogs from SimpleX Chat.
language: en
url: https://simplex.chat/,
author:
name: SimpleX Chat
email: chat@simplex.chat
---
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:base="{{ metadata.url }}">
<title>{{ metadata.title }}</title>
<subtitle>{{ metadata.subtitle }}</subtitle>
<link href="{{ permalink | absoluteUrl(metadata.url) }}" rel="self"/>
<link href="{{ metadata.url }}"/>
<updated>{{ collections.blogs | getNewestCollectionItemDate | dateToRfc3339 }}</updated>
<id>{{ metadata.url }}</id>
<author>
<name>{{ metadata.author.name }}</name>
<email>{{ metadata.author.email }}</email>
</author>
{%- for blog in collections.blogs | reverse %}
{%- set absolutePostUrl = blog.url | absoluteUrl(metadata.url) %}
<entry>
<title>{{ blog.data.title }}</title>
<link href="{{ absolutePostUrl }}"/>
{# <updated>{{ blog.date | dateToRfc3339 }}</updated> #}
<updated>{{ blog.data.date.toUTCString().split(' ').slice(1, 4).join(' ') }}</updated>
<id>{{ absolutePostUrl }}</id>
<content xml:lang="{{ metadata.language }}" type="html">{{ blog.templateContent | htmlToAbsoluteUrls(absolutePostUrl) }}</content>
{# <content xml:lang="{{ metadata.language }}" type="html">{{ blog.templateContent | striptags | truncate(200) }}</content> #}
</entry>
{%- endfor %}
</feed>
+35
View File
@@ -0,0 +1,35 @@
---
permalink: feed.rss
eleventyExcludeFromCollections: true
metadata:
title: SimpleX Chat Blog
subtitle: It allows you to stay up to date with the latest Blogs from SimpleX Chat.
language: en
url: https://simplex.chat/,
author:
name: SimpleX Chat
email: chat@simplex.chat
---
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:base="{{ metadata.url }}" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ metadata.title }}</title>
<link>{{ metadata.url }}</link>
<atom:link href="{{ permalink | absoluteUrl(metadata.url) }}" rel="self" type="application/rss+xml"/>
<description>{{ metadata.subtitle }}</description>
<language>{{ metadata.language }}</language>
{%- for blog in collections.blogs %}
{%- set absolutePostUrl = blog.url | absoluteUrl(metadata.url) %}
<item>
<title>{{ blog.data.title }}</title>
<link>{{ absolutePostUrl }}</link>
<description>{{ blog.templateContent | htmlToAbsoluteUrls(absolutePostUrl) }}</description>
{# <description>{{ blog.templateContent | striptags | truncate(200) }}</description> #}
{# <pubDate>{{ blog.data.date | dateToRfc822 }}</pubDate> #}
<pubDate>{{ blog.data.date.toUTCString().split(' ').slice(1, 4).join(' ') }}</pubDate>
<dc:creator>{{ metadata.author.name }}</dc:creator>
<guid>{{ absolutePostUrl }}</guid>
</item>
{%- endfor %}
</channel>
</rss>