Hugo

Add a RSS link on your hugo site

Add a RSS link on your hugo site

I love twitter and use it to keep up to date on the latest tech announcements. However, it can be easy to miss things especially when a product changes as much as Azure. So I subscribe to RSS feeds for the tech i’m interested in and I find they work well.

Looking at the hugo documentation, Hugo comes out of the box with RSS functionality. Although the docs also say you have to add code to your header.html to enable this.

I tried this and it didn’t add an RSS link as it described. So, I tried just adding /index.xml to the end of my website url in my browser and it returned an RSS feed. Yeh!

RSS xml information

So all I needed to do now was add a link somewhere on my site for the RSS feed. There is already a social section in the config.toml, so I just added a link to the index.xml file and referenced in an icon from themify.

The config.toml went from this

############################# social site ########################
[[params.social]]
title = "twitter"
icon = "ti-twitter-alt" # themify icon : https://themify.me/themify-icons
link = "https://twitter.com/cgfootman"

[[params.social]]
title = "github"
icon = "ti-github" # themify icon : https://themify.me/themify-icons
link = "https://github.com/ChrisGibson1982"

[[params.social]]
title = "linkedin"
icon = "ti-linkedin" # themify icon : https://themify.me/themify-icons
link = "https://www.linkedin.com/in/cgfootman/"

to this

############################# social site ########################
[[params.social]]
title = "twitter"
icon = "ti-twitter-alt" # themify icon : https://themify.me/themify-icons
link = "https://twitter.com/cgfootman"

[[params.social]]
title = "github"
icon = "ti-github" # themify icon : https://themify.me/themify-icons
link = "https://github.com/ChrisGibson1982"

[[params.social]]
title = "linkedin"
icon = "ti-linkedin" # themify icon : https://themify.me/themify-icons
link = "https://www.linkedin.com/in/cgfootman/"

[[params.social]]
title = "rss"
icon = "ti-rss" # themify icon : https://themify.me/themify-icons
link = "https://www.cgfootman.com/index.xml"

Before the changing the config.toml

Before RSS Change Before RSS Change

After the changing the config.toml

Before RSS Change Before RSS Change

I’m using the liva-hugo theme so it may look different on you site, however the change to the config.toml file should still produce the rss link. Please let me know if you have any issues in the comments.