How to generate pages excluding specific RSS?

If this topic already appeared, sorry for my question. I couldn’t search the same topic.

Can Hugo control RSS feed?

I’m using Hugo for my site, it includes “blog posts” and “about me page”.
Please let me know how to generate pages excluding “about me page RSS”.

Thanks.

As you noticed Hugo includes, by default, all pages in the RSS feed. You’ve to overwrite Hugo’s internal RSS template with your own.

Have a look at the example shown in the documentation. The following part needs to be modified:

{{ range first 15 .Data.Pages }}
// insert page data
{{ end }}

You can filter templates with the where function. The script below only includes pages from the post section.

{{ range first 15 (where .Data.Pages "Section" "post") }}
// insert page data
{{ end }}
3 Likes

Great!
Thank you for your reply.
I’ll try it :slightly_smiling: