Multiple RSS feed for single section

Hey all?
I’d like to create multiple RSS feeds for a podcast because I’d like to customize each one for a series of distribution platforms (eg Spotify, iTunes, Stitcher, etc…) Some platforms have unique fields and we’d like to use some fields in different ways in different platforms.

Is there any way to create multiple customized xml files for the same section? I’m not seeing it but I may be missing something. Thanks!

Via https://gohugo.io/templates/output-formats/.

example for an custom RSS feed

[outputFormats.FEED]
    MediaType             = "application/rss+xml"
    BaseName              = "feed"
    IsHTML                = false
    IsPlainText           = true
    noUgly                = true
    Rel                   = "alternate"


[outputs]
    home                  = [ "HTML", "ATOM", "JSON", "FEED"]

template name is home.feed.rss

I’ve done this, bc. my own RSS feed collided with the buildin.

2 Likes

Hi @maiki, @ju52, are the solutions you’re mentioning above applicable if I want lots of the same type for a single page. eg:

For a single page at https://www.example.com, I want:

  • https://www.example.com/index-1.xml (type: application/rss+xml)
  • https://www.example.com/index-2.xml (type: application/rss+xml)
  • https://www.example.com/index-3.xml (type: application/rss+xml)

They’d all be fed from the same list items on https://www.example.com but I’d create individual xml files, each of which I’ve configured with different parameters.

Thanks! :grinning:

Few years later I comment this topic because I have exactly the same question and I found a way for producing multiple RSS feeds with custom names/URLs:

Use case

I want to produce a custom RSS for a big part of my posts (range in different sections), his name is atom.xml.
I also want to produce another custom RSS for a particular section (now section), his name is now.xml.

The result I want:

├── now
│   └── ...
├── now.xml
└── atom.xml

Outputs

I have to describe which outputs I want:

[outputs]
  home = ["HTML", "atom"]
  section = ["HTML", "now"]

Output Formats

And these are the custom output formats:

[outputFormats]
  [outputFormats.atom]
    mediatype = "application/rss"
    rel = "atom"
    baseName = "atom"
  [outputFormats.now]
    mediatype = "application/rss"
    rel = "now"
    baseName = "now"

Templates

I need two templates:

  • for atom.xml: /layouts/_default/index.atom.xml
  • for now.xml: '/layouts/section/now.now.xml`

It works for me, I hope this can help someone!