site/templates/rss.xml
Simon Bruder e648b8f1b0
Add owner email to feed
It is required by some podcast directories.
2022-01-12 20:00:15 +01:00

54 lines
3 KiB
XML

{%- import "macros.html" as macros -%}
{%- set format = config.extra.formats | filter(attribute="ext", value=term.name | default(value="opus")) | first -%}
{%- set episodes_meta = load_data(path="static/episodes.json") -%}
<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0">
<channel>
<title>{{ config.title }}</title>
<link>{{ config.base_url | escape_xml | safe }}</link>
<description>{{ config.description }}</description>
<language>{{ lang }}</language>
<lastBuildDate>{{ last_updated | date(format="%a, %d %b %Y %H:%M:%S %z") }}</lastBuildDate>
{%- if taxonomy -%}
{% for format in config.extra.formats %}
<atom:link rel="{% if format.ext == term.name %}self{% else %}alternate{% endif %}" type="application/rss+xml" title="{{ config.title }} ({{ format.name }})" href="{{ get_url(path="formats/" ~ format.ext ~ "/rss.xml") | escape_xml | safe }}"/>
{%- endfor %}
{%- endif %}
<image>
<url>{{ get_url(path="assets/poster.jpg") | escape_xml | safe }}</url>
<title>{{ config.title }}</title>
<link>{{ config.base_url | escape_xml | safe }}</link>
</image>
<itunes:author>{{ config.extra.author }}</itunes:author>
<itunes:owner>
<itunes:email>{{ config.extra.itunes.owner_email }}</itunes:email>
</itunes:owner>
<itunes:summary>{{ config.description }}</itunes:summary>
<itunes:image href="{{ get_url(path="assets/poster.jpg") | safe }}"/>
<itunes:subtitle>{{ config.extra.subtitle }}</itunes:subtitle>
{%- for page in pages %}
{%- set episode_meta = episodes_meta[page.slug] -%}
<item>
<title>{{ page.title }}</title>
<link>{{ page.permalink | escape_xml | safe }}</link>
<guid>{{ page.permalink | escape_xml | safe }}</guid>
<pubDate>{{ page.date | date(format="%a, %d %b %Y %H:%M:%S %z") }}</pubDate>
<description><![CDATA[{{ page.description }}]]></description>
<atom:link rel="http://podlove.org/deep-link" href="{{ page.permalink | escape_xml | safe }}#"/>
<enclosure url="{{ get_url(path="episodes/" ~ page.slug ~ "." ~ format.ext) | escape_xml | safe }}" length="{{ episode_meta.formats[format.ext].size }}" type="{{ format.mime_type | escape_xml | safe }}"/>
<itunes:duration>{{ episode_meta.duration }}</itunes:duration>
<itunes:author>{{ config.extra.author }}</itunes:author>
<itunes:subtitle>{{ page.extra.subtitle }}</itunes:subtitle>
<itunes:episode>{{ page.extra.episode }}</itunes:episode>
<itunes:summary>{{ page.description }}</itunes:summary>
<content:encoded><![CDATA[<p><strong>{{ page.extra.subtitle }}</strong></p> <p>{{ page.description}}</p> {{ page.content | safe }}]]></content:encoded>
{%- for contributor in page.extra.contributors %}
<atom:contributor>
<atom:name>{{ contributor }}</atom:name>
</atom:contributor>
{%- endfor %}
</item>
{%- endfor %}
</channel>
</rss>