Selectively disabling gohugo RSS feeds
SoftwareThe Hugo static site generator creates four types of RSS feeds, for:
- the whole site
- each section, such as
posts
andpages
- each taxonomy, such as
categories
andtags
- each taxonomy value, such as the
weeb
tag
You can disable all of them, but you can’t pick and choose. I’m not a Go developer, but if I were it’d be the #1 feature I’d request and help build.
I wanted feeds for my root site and for categories, but I didn’t want for tags. My blog is almost old enough to be a learner driver, so has accumulated thousands of tags, which means as many superfluous RSS feeds.
My terrible hack to spare CPU cycles is creating an empty template for the taxonomies I don’t want feeds for:
$ touch ./layouts/taxonomy/tags.xml
Hugo’s tag feeds will now be empty, save for an XML header. Then you can edit your web server configuration to 404 on these.
This one trick shaves between 10-15% off my build times.