1
Fork 0

Add feeds for tagged posts

This commit is contained in:
Jan-Erik Rediger 2019-01-21 20:06:41 +01:00
parent ec9095cd26
commit e4935af799
5 changed files with 49 additions and 0 deletions

View file

@ -13,6 +13,7 @@ data:
{% for tag in page.data.tags %}
<li>
<a href="/tagged/{{tag}}.html">{{tag}}</a>
(<a href="/tagged/{{tag}}.xml">Feed for {{tag}}</a>)
</li>
{% endfor %}
</ul>

View file

@ -6,6 +6,8 @@ data:
route: posts
---
<a href="/tagged/mozilla.xml">RSS Feed</a>
<ul>
{% for post in collections.posts.pages %}
{%- if post.data.tags and post.data.tags contains "mozilla" -%}

22
tagged/mozilla.xml.liquid Normal file
View file

@ -0,0 +1,22 @@
---
permalink: /tagged/mozilla.xml
---
<rss version="2.0">
<channel>
<title>fnordig - posts tagged with 'mozilla'</title>
<link>https://fnordig.de</link>
<description>fnordig - posts tagged with 'mozilla'</description>
{% for post in collections.posts.pages %}
{%- if post.data.tags and post.data.tags contains "mozilla" -%}
<item>
<title>{{ post.title | escape }}</title>
<link>https://fnordig.de/{{ post.permalink }}</link>
<description>{{ post.content | escape }}</description>
<guid>https://fnordig.de/{{ post.permalink }}</guid>
<pubDate>{{ post.published_date | date: "%a, %d %b %Y %H:%M:%S %z" }}</pubDate>
</item>
{% endif -%}
{% endfor %}
</channel>
</rss>

View file

@ -6,6 +6,8 @@ data:
route: posts
---
<a href="/tagged/rust.xml">RSS Feed</a>
<ul>
{% for post in collections.posts.pages %}
{%- if post.data.tags and post.data.tags contains "rust" -%}

22
tagged/rust.xml.liquid Normal file
View file

@ -0,0 +1,22 @@
---
permalink: /tagged/rust.xml
---
<rss version="2.0">
<channel>
<title>fnordig - posts tagged with 'rust'</title>
<link>https://fnordig.de</link>
<description>fnordig - post tagged with 'rust'</description>
{% for post in collections.posts.pages %}
{%- if post.data.tags and post.data.tags contains "rust" -%}
<item>
<title>{{ post.title | escape }}</title>
<link>https://fnordig.de/{{ post.permalink }}</link>
<description>{{ post.content | escape }}</description>
<guid>https://fnordig.de/{{ post.permalink }}</guid>
<pubDate>{{ post.published_date | date: "%a, %d %b %Y %H:%M:%S %z" }}</pubDate>
</item>
{% endif -%}
{% endfor %}
</channel>
</rss>