add atom feed and make RSS feed work with images

This commit is contained in:
Set Hallstrom 2020-11-17 00:22:50 +01:00
parent de554bc5d2
commit d635e5faf9
2 changed files with 29 additions and 15 deletions

View File

@ -4,22 +4,35 @@ layout: nil
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title type="text" xml:lang="en">{{ site.title }}</title>
<link type="application/atom+xml" href="{{ site.url }}/feed.xml" rel="self"/>
<subtitle>{{ site.description | xml_escape }}</subtitle>
<link type="application/atom+xml" href="{{ site.url }}/atom.xml" rel="self"/>
<link type="text/html" href="{{ site.url }}/" rel="alternate"/>
<updated>{{ site.time | date_to_xmlschema }}</updated>
<id>{{ site.url }}/feed.xml</id>
<id>{{ site.url }}/atom.xml</id>
<author>
<name>{{ site.publisher.name }}</name>
<email>{{ site.publisher.mail }}</email>
</author>
<rights>Copyleft {{ site.time | date: '%Y' }} {{ site.publisher.name }}</rights>
<icon>{{ site.url }}{{ site.icon }}</icon>
<logo>{{ site.url }}{{ site.icon }}</logo>
{% for post in site.posts limit:20 %}
{% for post in site.posts limit:10 %}
<entry>
<title>{{ post.title }}</title>
<link href="{{ site.url }}{{ post.url }}"/>
<updated>{{ post.date | date_to_xmlschema }}</updated>
<id>home_url{{ post.id }}</id>
<content type="html">{{ post.content | xml_escape }}</content>
<published>{{ post.date | date_to_xmlschema }}</published>
<updated>{{ post.last_modified_at | date_to_xmlschema }}</updated>
<id>{{ site.url }}{{ post.url }}</id>
<content type="html">{{ post.content | strip_html | truncate: 220 | xml_escape }}</content>
<summary>{{ post.description }}</summary>
<author>
{% assign author_id = post.author | prepend: "/authors/" | append: "/" %}
{% assign author = site.authors | where: "url", author_id | first %}
<name>{{ author.name }}</name>
<email>{{ author.email }}</email>
<uri>{{ author.url_staff }}</uri>
</author>
</entry>
{% endfor %}
</feed>

View File

@ -2,18 +2,16 @@
layout: nil
title : The Basspistol RSS Feed
---
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" >
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/">
<channel>
<title>{{ site.title | xml_escape }}</title>
<atom:link href="{{ site.url }}/rss.xml" rel="self" type="application/rss+xml" />
<atom:link href="{{ site.url }}/atom.xml" rel="self" type="application/rss+xml" />
<link>{{ site.url }}</link>
<description>{{ site.description | xml_escape }}</description>
<lastBuildDate>{{ site.time | date_to_rfc822 }}</lastBuildDate>
<language>en-US</language>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<generator>https://jekyllrb.com/</generator>
<image>
<url>{{ site.url }}/siteicon.png</url>
@ -31,10 +29,13 @@ title : The Basspistol RSS Feed
<guid isPermaLink="true">{{ site.url }}{{ post.url }}</guid>
<description>{{ post.description | truncate: 200 | xml_escape }}</description>
<category>Hi-Lights</category>
<author>{{ site.publisher.mail | xml_escape }} ({{ site.publisher.name }})</author>
{% assign author_id = post.author | prepend: "/authors/" | append: "/" %}
{% assign author = site.authors | where: "url", author_id | first %}
<dc:creator>{{ author.name }}</dc:creator>
<author>{{ author.email }} ({{ author.name }})</author>
<pubDate>{{ post.date | date_to_rfc822 }}</pubDate>
<media:thumbnail url="{{ site.url }}{{ post.image }}"></media:thumbnail>
<media:title type="plain">{{ post.title | xml_escape }}</media:title>
<media:thumbnail url="{{ site.url }}{{ post.image }}" {% imagesize {{ post.image }}:props %}></media:thumbnail>
<media:title type="pl ain">{{ post.title | xml_escape }}</media:title>
</item>
{% endfor %}
</channel>