aboutsummaryrefslogtreecommitdiff
path: root/_includes
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--_includes/feed.atom104
1 files changed, 79 insertions, 25 deletions
diff --git a/_includes/feed.atom b/_includes/feed.atom
index e627f9c..9facc5a 100644
--- a/_includes/feed.atom
+++ b/_includes/feed.atom
@@ -1,34 +1,88 @@
-<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="{{ include.lang }}">
- <link href="{{ page.url | absolute_url }}" rel="self" type="application/atom+xml" />
- <link href="{{ '/' | absolute_url }}" rel="alternate" type="text/html" hreflang="{{ include.lang }}" />
- <updated>{{ site.time | date_to_xmlschema }}</updated>
- <id>{{ page.url | absolute_url | xml_escape }}</id>
+{% assign is_audio=site.atom[include.kind].audio %}<?xml version="1.0" encoding="UTF-8"?>
+ {% if is_audio %}
+ <rss version="2.0"
+ xmlns:atom="http://www.w3.org/2005/Atom">
+ <channel>
+ <title>{{ site.t.podcasts.feed.title }}</title>
+ <description>{{ site.t[include.kind].feed.title[include.lang] | smartify | xml_escape }}</description>
+ <link>{{ page.url | absolute_url | xml_escape }}</link>
+ <atom:link href="{{ page.url | absolute_url | xml_escape }}" rel="self" type="application/atom+xml" />
+ <language>{{ include.lang }}</language>
+ <copyright>CC BY-SA 4.0</copyright>
- <title>{{ site.title | xml_escape }}</title>
- <subtitle>{{ site.t[include.kind].feed.title[include.lang] | smartify | xml_escape }}</subtitle>
+ <!-- <lastBuildDate>{{ site.time | date_to_xmlschema }}</lastBuildDate> -->
+ <!-- <pubDate>FIXME</pubDate> -->
+ <!-- <docs>http://blogs.law.harvard.edu/tech/rss</docs> -->
+ <lastBuildDate>Sat, 25 Mar 2006 11:30:00 -0500</lastBuildDate>
+ <pubDate>Sat, 25 Mar 2006 11:30:00 -0500</pubDate>
+ <docs>http://blogs.law.harvard.edu/tech/rss</docs>
- <author>
- <name>{{ site.author.name | xml_escape }}</name>
- <email>{{ site.author.email | xml_escape }}</email>
- </author>
-
- {% assign entries = include.entries | where:"lang", include.lang | has_category:include.categories_filter | sort: "date" | reverse %}
- {% for entry in entries %}
- <entry xml:lang="{{ entry.lang }}">
- <title type="html">{{ entry.title | smartify | strip_html | normalize_whitespace | xml_escape }}</title>
- <link href="{{ entry.url | absolute_url }}" rel="alternate" type="text/html" title="{{ entry.title | xml_escape }}" />
- <published>{{ entry.date | date_to_xmlschema }}</published>
- <updated>{{ entry.updated_at | default: entry.date | date_to_xmlschema }}</updated>
- <id>{{ entry.url | absolute_url | xml_escape }}</id>
-
- <content type="html" xml:base="{{ entry.url | absolute_url | xml_escape }}">{{ entry.content | strip | xml_escape }}</content>
+ <webMaster>{{ site.author.email | xml_escape }} ({{ site.author.name | xml_escape }})</webMaster>
+ <image>
+ <url>https://hipsters.tech/wp-content/uploads/2016/07/hipsters-logo.png</url>
+ <link>{{ page.url | absolute_url | xml_escape }}</link>
+ <title>{{ site.t.podcasts.feed.title }}</title>
+ </image>
+ {% else %}
+ <feed
+ xmlns="http://www.w3.org/2005/Atom"
+ xmlns:content="http://purl.org/rss/1.0/modules/content/"
+ xml:lang="{{ include.lang }}">
+ <link href="{{ page.url | absolute_url | xml_escape }}" rel="self" type="application/atom+xml" />
+ <link href="{{ '/' | absolute_url | xml_escape }}" rel="alternate" type="text/html" hreflang="{{ include.lang }}" />
+ <title>{{ site.title | xml_escape }}</title>
+ <subtitle>{{ site.t[include.kind].feed.title[include.lang] | smartify | xml_escape }}</subtitle>
+ <id>{{ page.url | absolute_url | xml_escape }}</id>
+ <updated>{{ site.time | date_to_xmlschema }}</updated>
<author>
<name>{{ site.author.name | xml_escape }}</name>
<email>{{ site.author.email | xml_escape }}</email>
</author>
+ {% endif %}
+
+ {% assign entries = include.entries | where:"lang", include.lang | has_category:include.categories_filter | sort: "date" | reverse %}
+ {% for entry in entries %}
+ {% if is_audio %}
+ <item>
+ <title>{{ entry.title | smartify | strip_html | normalize_whitespace | xml_escape }}</title>
+ <link>{{ entry.url | absolute_url | xml_escape }}</link>
+ <guid>{{ entry.url | absolute_url | xml_escape }}</guid>
+ <description xml:base="{{ entry.url | absolute_url | xml_escape }}">
+ {{ entry.content | strip | xml_escape }}
+ </description>
+ <enclosure url="{{ '/' | absolute_url | xml_escape }}resources/podcasts/{{ include.lang }}/{{ entry.date | date: "%Y-%m-%d" }}-{{ entry.ref }}.ogg" type="audio/ogg" length="11779397" />
+ <category>EuAndreh</category>
+ <pubDate>Sat, 25 Mar 2006 11:30:00 -0500</pubDate>
+ <!-- <image> -->
+ <!-- <url>https://hipsters.tech/wp-content/uploads/2016/07/hipsters-logo.png</url> -->
+ <!-- </image> -->
+ </item>
+ {% else %}
+ <entry xml:lang="{{ entry.lang }}">
+ <title type="html">{{ entry.title | smartify | strip_html | normalize_whitespace | xml_escape }}</title>
+ <link href="{{ entry.url | absolute_url | xml_escape }}" rel="alternate" type="text/html" title="{{ entry.title | xml_escape }}" />
+ <published>{{ entry.date | date_to_xmlschema }}</published>
+ <updated>{{ entry.updated_at | default: entry.date | date_to_xmlschema }}</updated>
+ <id>{{ entry.url | absolute_url | xml_escape }}</id>
+
+ <content type="html" xml:base="{{ entry.url | absolute_url | xml_escape }}">
+ {{ entry.content | strip | xml_escape }}
+ </content>
- <summary type="html">{{ entry.excerpt | strip_html | normalize_whitespace | xml_escape }}</summary>
- </entry>
+ <author>
+ <name>{{ site.author.name | xml_escape }}</name>
+ <email>{{ site.author.email | xml_escape }}</email>
+ </author>
+
+ <summary type="html">{{ entry.excerpt | strip_html | normalize_whitespace | xml_escape }}</summary>
+ </entry>
+ {% endif %}
{% endfor %}
-</feed>
+
+{% if is_audio %}
+ </channel>
+ </rss>
+{% else %}
+ </feed>
+{% endif %}