Hey guys!
I’m working on a little podcast and wanted to knock out the required feed and utilise variables rather than manually modifying it. Unfortunately, when building and serving locally the variables aren’t pulling in the correct data.
I created the XML file in show/index.xm
l prior to building.
<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
<title>{{ site.title }}</title>
<description>{{ site.description | xml_escape }}</description>
<link>{{ site.url }}</link>
<language>en-uk</language>
<copyright>2021-{{ site.time | "%Y" }} {{ site.title }}</copyright>
<pubDate>{{ site.time | date_to_rfc822 }}</pubDate>
<lastBuildDate>{{ site.time | date_to_rfc822 }}</lastBuildDate>
<image>
<link>{{ site.url }}</link>
<url>{{ site.url }}/images/itunes.png</url>
<title>{{ site.title }}</title>
</image>
<itunes:subtitle>{{ site.description | xml_escape }}</itunes:subtitle>
<itunes:author>{{ site.author }}</itunes:author>
<itunes:summary>{{ site.description | xml_escape }}</itunes:summary>
<itunes:keywords>{{ site.keywords }}</itunes:keywords>
<itunes:owner>
<itunes:name>{{ site.author }}</itunes:name>
<itunes:email>{{ site.email }}</itunes:email>
</itunes:owner>
<itunes:image href="{{ site.url }}/images/itunes.png" />
<itunes:category text="Arts">
<itunes:category text="Food" />
</itunes:category>
<itunes:explicit>no</itunes:explicit>
{% for post in site.posts %}
<item>
<title>{{ post.title | xml_escape }}</title>
<link>{{ site.url }}{{ post.url }}</link>
<pubDate>{{ post.date | date_to_rfc822 }}</pubDate>
<description>{{ post.excerpt | xml_escape }}</description>
<guid isPermaLink="true">{{ site.url }}{{ post.url }}</guid>
<enclosure url="https://{{ post.file }}" length="{{ post.length }}" type="audio/mp3"/>
<itunes:author>{{ site.author }}</itunes:author>
<itunes:subtitle>{{ site.title }}: {{ post.title }}</itunes:subtitle>
<itunes:summary>{{ post.summary | xml_escape }}</itunes:summary>
<itunes:duration>{{ post.duration }}</itunes:duration>
<itunes:keywords>{{ post.keywords }}</itunes:keywords>
<itunes:image href="{{ site.url }}/images/itunes.png" />
<itunes:explicit>no</itunes:explicit>
</item>
{% endfor %}
</channel>
</rss>
Any help is great appreciated.