web: update feed (#4255)

* web: update feed

* change date filter in feed.rss
This commit is contained in:
M. Sarmad Qadeer 2024-06-17 02:31:36 +05:00 committed by GitHub
parent 7cd35b9068
commit c4083e00c5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 16 additions and 13 deletions

View file

@ -11,28 +11,31 @@ metadata:
email: chat@simplex.chat email: chat@simplex.chat
--- ---
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:base="{{ metadata.url }}"> <feed xmlns="http://www.w3.org/2005/Atom" xml:lang="{{ metadata.language }}">
<id>{{ metadata.url }}</id>
<link type="text/html" rel="alternate" href="{{ metadata.url }}"/>
<link type="application/atom+xml" rel="self" href="{{ permalink | absoluteUrl(metadata.url) }}"/>
<title>{{ metadata.title }}</title> <title>{{ metadata.title }}</title>
<subtitle>{{ metadata.subtitle }}</subtitle> <subtitle>{{ metadata.subtitle }}</subtitle>
<link href="{{ permalink | absoluteUrl(metadata.url) }}" rel="self"/>
<link href="{{ metadata.url }}"/>
<updated>{{ collections.blogs | getNewestCollectionItemDate | dateToRfc3339 }}</updated> <updated>{{ collections.blogs | getNewestCollectionItemDate | dateToRfc3339 }}</updated>
<id>{{ metadata.url }}</id>
<author> <author>
<name>{{ metadata.author.name }}</name> <name>{{ metadata.author.name }}</name>
<email>{{ metadata.author.email }}</email> <email>{{ metadata.author.email }}</email>
</author> </author>
{%- for blog in collections.blogs | reverse %} {%- for blog in collections.blogs | reverse %}
{%- if not blog.data.draft %} {%- if not blog.data.draft %}
{%- set absolutePostUrl = blog.url | absoluteUrl(metadata.url) %} {%- set absolutePostUrl = blog.data.permalink | absoluteUrl(metadata.url) %}
<entry> <entry>
<id>{{ blog.data.permalink | absoluteUrl(metadata.url) }}</id>
<!-- <updated>{{ blog.data.date.toUTCString().split(' ').slice(1, 4).join(' ') }}</updated> -->
<updated>{{ blog.data.date | dateToRfc3339 }}</updated>
<link rel="alternate" type="text/html" href="{{ absolutePostUrl }}"/>
<title>{{ blog.data.title }}</title> <title>{{ blog.data.title }}</title>
<link href="{{ absolutePostUrl }}"/> <content type="html">{{ blog.templateContent | htmlToAbsoluteUrls(absolutePostUrl) }}</content>
{# <updated>{{ blog.date | dateToRfc3339 }}</updated> #} <author>
<updated>{{ blog.data.date.toUTCString().split(' ').slice(1, 4).join(' ') }}</updated> <name>{{ metadata.author.name }}</name>
<id>{{ absolutePostUrl }}</id> <email>{{ metadata.author.email }}</email>
<content xml:lang="{{ metadata.language }}" type="html">{{ blog.templateContent | htmlToAbsoluteUrls(absolutePostUrl) }}</content> </author>
{# <content xml:lang="{{ metadata.language }}" type="html">{{ blog.templateContent | striptags | truncate(200) }}</content> #}
</entry> </entry>
{%- endif %} {%- endif %}
{%- endfor %} {%- endfor %}

View file

@ -26,8 +26,8 @@ metadata:
<link>{{ absolutePostUrl }}</link> <link>{{ absolutePostUrl }}</link>
<description>{{ blog.templateContent | htmlToAbsoluteUrls(absolutePostUrl) }}</description> <description>{{ blog.templateContent | htmlToAbsoluteUrls(absolutePostUrl) }}</description>
{# <description>{{ blog.templateContent | striptags | truncate(200) }}</description> #} {# <description>{{ blog.templateContent | striptags | truncate(200) }}</description> #}
{# <pubDate>{{ blog.data.date | dateToRfc822 }}</pubDate> #} <pubDate>{{ blog.data.date | dateToRfc822 }}</pubDate>
<pubDate>{{ blog.data.date.toUTCString().split(' ').slice(1, 4).join(' ') }}</pubDate> {# <pubDate>{{ blog.data.date.toUTCString().split(' ').slice(1, 4).join(' ') }}</pubDate> #}
<dc:creator>{{ metadata.author.name }}</dc:creator> <dc:creator>{{ metadata.author.name }}</dc:creator>
<guid>{{ absolutePostUrl }}</guid> <guid>{{ absolutePostUrl }}</guid>
</item> </item>