Multiple RSS Feeds

#1

I want to create a podcast site with zola and I’d like to have two feeds: One for mp3 files and one for opus files.
The docs imply that you can only have one feed per site called rss.xml and I’ve found no discussions about this. I’ve tried adding xml template files with different names but they get ignored.

Is there a way with current zola, to get multiple feeds or would that be a feature request?

#2

You can have a per taxonomy feed so you can create a dummy taxonomy with 2 terms: mp3 and opus and you will get two RSS feeds (in addition to the site one if you want to have it)

#3

Ah, that makes sense. I added a taxonomy called feed (for a nice looking URL) and added the default single.html and list.html templates from the docs. Then I tagged each post with opus and mp3 and now two feeds, /feed/mp3/rss.xml and /feed/opus/rss.xml are generated.
However, I haven’t figured out how the name spacing seems to work. I’ve tried a few methods but haven’t gotten the rss.xml template to render the tag name (needed for the file endings of the audio files) into the feeds. How can I do that?

#4

I did a workaround:

{%- if feed_url is containing("mp3") -%}
{%- set audioFilePostfix = ".mp3" -%}
{%- set audioFileType = "audio/mpeg" -%}
{%- else -%}
{%- set audioFilePostfix = ".opus" -%}
{%- set audioFileType = "audio/ogg; codecs=opus" -%}
{%- endif -%}

but I suspect that there is a better solution for this :smiley: