Creating a single-purpose RSS feed

I have an existing site with an RSS feed at /index.xml for blog posts, which I don’t want to change. I want to create a couple of new RSS feeds for specific purposes:

The first is the same posts as the standard RSS feed, but instead of using .Content it will use .Summary. I want this to be located at /summary.xml

The second will have only specific pages on a topic (say, penguins) and will be located at, say, /penguins.xml. I’m planning to create a “menu” and in each page’s front matter that I want in this feed, I’ll just say “menu: penguins” and then reference that menu in the RSS template.

My question is not how to write the templates - that seems easy and I’m having no trouble copying and modifying the standard RSS template - my question is how to get the rendered site to have these specific paths and content. I’m having no luck searching; perhaps I haven’t thought of the right search terms. I’ve tried a few options, without success:

  1. Put a file into /content/summary.xml, for example, and put template code in it. Doesn’t work, it just gets copied as a static file to the output.
  2. Put a file into /static/summary.xml, but the same problem happens.
  3. Put a markdown file into /content, mostly empty and perhaps just with front matter; and let it be rendered with a template where the logic will live; but it’s not a page or blog; what content type would I specify for it? Not sure where to start with this idea.

For this you would have to look into

The normal use case is to define RSS as an extra output format for a given page, but if you want many feeds, you may want to just create a bunch of “single pages” and set outputs and either Type or Layout in front matter to pick the correct template.

Thank you! Let me check if I understand. I’ll focus just on the penguins feed as an example. If I can get this working I’m sure I can do the other one too. I’ll take the following steps:

  1. Create content/ with the following contents:

    date: 2018-03-19
    layout: penguins
    - rss
  2. Create layouts/penguins/list.xml with contents like the following:
    <rss version="2.0" xmlns:atom=""> <channel> ... {{ range first 20 .Site.Menus.penguins }} ...

But how do I get Hugo to render this single page with the list layout template? I’m not sure about that.

  • Your will resolve to a regular page in Hugo (single page, leaf page, many names …)
  • See
  • So, you have Type (defaults to section) and Layout you can use to control what template. With your example a layout in layouts/_default/penguins.xml should work, but there are many options here.

I’m a little confused. Should I set type: section and layout: penguins in front matter to get it to choose that template?

No …

So, Hugo tries to find the most specific template.

We use Type and Layout as some of the criterias.

Layout is considered “most specific” – so no need to mess with other settings if that is good enough.

Thanks. I’m still working on deciding the best way to do this from the several options. One option for the penguins feed, for example, is simply to create a new taxonomy and have it rendered only as RSS, so each post that I want in the penguins RSS feed could simply add this in the front matter. This is seeming like a simpler way to go at the moment:

- Penguins

SOLVED It took a while but I got around to doing this. It was pretty simple, I was just confused about the different options and how they were different from each other.

Short version: create a content file with a layout parameter in front matter. The value of that parameter should match the name of a layout file under layouts/_default/.

Real example Git commit where I got this working: This produces a special-purpose RSS feed at the URL /mailchimp/index.xml