Skip to content

Commit 1e89d8c

Browse files
committed
simplyfy and fix RSS feed
1 parent 545b8db commit 1e89d8c

File tree

2 files changed

+32
-54
lines changed

2 files changed

+32
-54
lines changed

feed-by.xml

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,20 @@
11
---
22
---
33
<?xml version="1.0" encoding="UTF-8"?>
4-
<rss version="2.0"
5-
xmlns:atom="http://www.w3.org/2005/Atom"
6-
xmlns:dc="http://purl.org/dc/elements/1.1/"
7-
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
8-
>
9-
<channel>
10-
<title>{{ site.title | xml_escape }}</title>
11-
<description>{% if site.description %}{{ site.description | xml_escape }}{% endif %}</description>
12-
<sy:updatePeriod>{{ site.feed_update_period | default: "daily" | xml_escape }}</sy:updatePeriod>
13-
<sy:updateFrequency>{{ site.feed_update_frequency | default: 1 | xml_escape }}</sy:updateFrequency>
14-
<link>{{ site.url }}</link>
15-
<atom:link href="{{ site.url }}/{{ page.path }}" rel="self" type="application/rss+xml" />
16-
{% assign sorted-posts = site.posts | where: "lang", "by" %}
17-
<lastBuildDate>{% for post in sorted-posts limit:1 %}{{ post.date | date_to_rfc822 }}{% endfor %}</lastBuildDate>
18-
{% for post in sorted-posts %}
19-
<item>
20-
<title>{{ post.title | xml_escape }}</title>
21-
{% if post.author.name %}
22-
<dc:creator>{{ post.author.name | xml_escape }}</dc:creator>
23-
{% endif %}
24-
<description>{{ post.content | markdownify | strip_newlines }}</description>
25-
<pubDate>{{ post.date | date_to_rfc822 }}</pubDate>
26-
<link>{{ site.url }}{{ post.url }}</link>
27-
<guid isPermaLink="true">{{ site.url }}{{ post.url }}</guid>
28-
</item>
29-
{% endfor %}
30-
</channel>
4+
<rss version="2.0">
5+
<channel>
6+
<title>{{ site.title | xml_escape }}</title>
7+
<link>{{ site.url | append: '/by/' }}</link>
8+
<description>{% if site.description %}{{ site.description | xml_escape }}{% endif %}</description>
9+
{% assign sorted-posts = site.posts | where: "lang", "by" %}
10+
{% for post in sorted-posts %}
11+
<item>
12+
<title>{{ post.title | xml_escape }}</title>
13+
<link>{{ site.url }}{{ post.url }}</link>
14+
<description>{{ post.content | markdownify | escape }}</description>
15+
<pubDate>{{ post.date | date_to_rfc822 }}</pubDate>
16+
</item>
17+
{% endfor %}
18+
</channel>
19+
3120
</rss>

feed.xml

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,20 @@
11
---
22
---
33
<?xml version="1.0" encoding="UTF-8"?>
4-
<rss version="2.0"
5-
xmlns:atom="http://www.w3.org/2005/Atom"
6-
xmlns:dc="http://purl.org/dc/elements/1.1/"
7-
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
8-
>
9-
<channel>
10-
<title>{{ site.title | xml_escape }}</title>
11-
<description>{% if site.description %}{{ site.description | xml_escape }}{% endif %}</description>
12-
<sy:updatePeriod>{{ site.feed_update_period | default: "daily" | xml_escape }}</sy:updatePeriod>
13-
<sy:updateFrequency>{{ site.feed_update_frequency | default: 1 | xml_escape }}</sy:updateFrequency>
14-
<link>{{ site.url }}</link>
15-
<atom:link href="{{ site.url }}/{{ page.path }}" rel="self" type="application/rss+xml" />
16-
{% assign sorted-posts = site.posts | where: "lang", "de" %}
17-
<lastBuildDate>{% for post in sorted-posts limit:1 %}{{ post.date | date_to_rfc822 }}{% endfor %}</lastBuildDate>
18-
{% for post in sorted-posts %}
19-
<item>
20-
<title>{{ post.title | xml_escape }}</title>
21-
{% if post.author.name %}
22-
<dc:creator>{{ post.author.name | xml_escape }}</dc:creator>
23-
{% endif %}
24-
<description>{{ post.content | markdownify | strip_newlines }}</description>
25-
<pubDate>{{ post.date | date_to_rfc822 }}</pubDate>
26-
<link>{{ site.url }}{{ post.url }}</link>
27-
<guid isPermaLink="true">{{ site.url }}{{ post.url }}</guid>
28-
</item>
29-
{% endfor %}
30-
</channel>
4+
<rss version="2.0">
5+
<channel>
6+
<title>{{ site.title | xml_escape }}</title>
7+
<link>{{ site.url | append: '/' }}</link>
8+
<description>{% if site.description %}{{ site.description | xml_escape }}{% endif %}</description>
9+
{% assign sorted-posts = site.posts | where: "lang", "de" %}
10+
{% for post in sorted-posts %}
11+
<item>
12+
<title>{{ post.title | xml_escape }}</title>
13+
<link>{{ site.url }}{{ post.url }}</link>
14+
<description>{{ post.content | markdownify | escape }}</description>
15+
<pubDate>{{ post.date | date_to_rfc822 }}</pubDate>
16+
</item>
17+
{% endfor %}
18+
</channel>
19+
3120
</rss>

0 commit comments

Comments
 (0)