RSS feed grabs every change on the site rather than the blog

I’m not a coder/developer, I’m just a regular non-techie person who knows enough about Terminal and recognizing HTML file structure that I was able to install Hugo and get it going. I’ve been trying to get this working for the last few months and struggling so much, and feeling too intimidated to post here. But I’m at the point where I’m ready to give it up if I can’t fix this, so I figure I might as well ask. I need to know if the answer requires knowing how to write Go or how to code (if so, that’s too much to learn now, but maybe I can come back to Hugo later).

I really like the way Hugo works, but I can’t get RSS to work properly. Right now the RSS feed for my site makes an entry for every single change, every new page made, every edit.

How do I make the RSS act like normal, where it grabs any new blog post - ONLY the blog (or whatever category I set), not every change over the whole site? This problem happens with every theme I try, so I don’t think it’s theme-specific.

Thanks!

If I understand you correctly, this is the desired behaviour of Hugo. Each section has an RSS feed.

So if you’re pointing to example.com/index.xml—that’s the RSS feed for every change. If you just want the RSS feed for your blog (and you store blog posts in content/blog), then use example.com/blog/index.xml.

Thanks for the reply. I understand what you’re saying, but everything I read about finding an RSS feed says, “Just use the domain.com/feed”. Like that’s the default. So if my domain is boop.com, how do I tell anyone who visits NOT to use boop.com/feed, but rather some other more specific feed? Do I just link to the more specific one and hope they don’t type boop.com/feed anywhere without clicking on my particular link?

You can either override the built-in RSS template to iterate over the desired pages:

{{- if .IsHome }}
  {{- $pages = where site.RegularPages "Section" "blog" }}
{{- end }}

Or insert something like this into the head of your home page:

<link rel="alternate" type="application/rss+xml" href="https://www.example.org/blog/index.xml" title="MySite">

I’d go with the first one.

1 Like