Commit df060bd2 authored by Nicolás Alvarez's avatar Nicolás Alvarez
Browse files

Sort posts by timestamp in the RSS and Atom feeds

Posts in the per-language feeds seem to be in the correct order, but the
global feed is only sorted by date ignoring the time (I think it's sorted
by _posts filename, ie. date + title).

This patch explicitly sorts posts by full timestamp before creating the
RSS and Atom feeds.
parent 5965944f
......@@ -12,7 +12,8 @@
<updated>{{ site.time | date_to_xmlschema }}</updated>
<id>https://planet.kde.org/</id>
<generator>Pluto</generator>
{% for post in paginator.posts %}
{% assign posts = paginator.posts | sort: "created_at" | reverse %}
{% for post in posts %}
<entry>
<id>{{ post.guid }}</id>
<author>
......
......@@ -7,7 +7,8 @@
<link>https://planet.kde.org{% if lang.name %}/{{ page.title }}{% endif %}</link>
<description>Planet KDE{% if lang.name %} | {{ lang.name }}{% endif %}</description>
<atom:link href="https://planet.kde.org{% if lang.name %}/{{ page.title }}{% endif %}/rss20.xml" rel="self" type="application/rss+xml"/>
{% for post in paginator.posts %}
{% assign posts = paginator.posts | sort: "created_at" | reverse %}
{% for post in posts %}
<item>
<guid isPermaLink="{% if post.guid contains '://' %}true{% else %}false{% endif %}">{{ post.guid }}</guid>
<title>{{ post.title | xml_escape }}</title>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment