Creating RSS feed for a section [SOLVED]

#1

Hi,

I’ve read through the docs and previous forum posts, but I’m still struggling with creating a RSS feed for a section.

My current layout structure:

- layouts
  - books
    - single.html
    - rss.xml
  - posts
    - single.html 
  - projects
    - single.html
  - section
    - books.html
    - posts.html
    - projects.html
  - index.html
  - rss.xml

Config.toml

[outputs]
  home = ["HTML", "RSS"]
  section = ["HTML", "RSS"]

In layouts/rss.xml I’m using the default RSS template that ships with Hugo, but with a few modifications. This RSS feed works and shows all posts from every section.

I now need to create another RSS feed that will only show the posts listed in the books section. I’ve tried to create a new RSS file under layouts/books but when I visit http://localhost:1313/books/index.xml, the template rendered is layouts/rss.xml and not layouts/books/rss.xml.

I’ve tried different naming conventions such as section.rss.xml, section.xml, books.rss, rss.xml etc.

I’m not sure if I’m placing the new RSS file in the correct spot, what name it should have and if my Config settings are correct. Any help is appreciated.

#2

The only way we can assist is if you share your site project, so we can see your templates and config. Please review Requesting Help and post your code! :slight_smile:

Based on your file tree, I’d expect /layouts/books/rss.xml to be picked up first in the section RSS template lookup order, so nothing pops out to me.