Exposing more content via RSS

It seems like there is a default limit imposed on the number of pieces of content exposed by Hugo to the RSS feed (about “15 pages” worth). Is there a way to configure it to export more (and perhaps all) content?

You can by providing your own _default/rss.xml template. Just copy and adapt the internal:

https://github.com/spf13/hugo/blob/master/tpl/template_embedded.go#L67

Thank you. Do you feel it will be a useful addition to Hugo to make this a configurable parameter? If so, I would like to attempt a contribution. :blush:

1 Like

Yes…

Thanks. I will try that soon.

Sorry about the necro, however:

I’ve altered the rss.xml, in both themes/THEME/layouts/_default/rss.xml and in layouts/rss.xml to:

{{ range first 250 .Data.Pages }}

however on render the number of rendered items remains static, at just 50 items.

Is this hardcoded at this point?

I can confirm that this is still the sort of solution I use, but I do it in Hugo’s source code (and recompile) locally. The only thing I can say is maybe your RSS template file is not being used or it’s in the wrong location?

No, the template file is being read correctly - as if I reduce the number below 50, then that renders correctly. Anything above 50, however, and only 50 pages are rendered.

There shouldn’t be any reason why Hugo locks up at 50 entries that I can think of.

I am sorry, I am not sure why.

Thanks Bep,

Looking at the github tracker, I see that MooreReason has already written a patch for just this issue, two days ago.

What’s a plausible expectation on that being picked up and merged into the codebase?

I will have to think about it. We have a little bit too much specific config options. This is related to configuration of the different output types (page Kind).

Not found. :frowning: