Hugo Feed Link

Yesterday I wrote about how to customize your Hugo RSS feed so that you have one feed named feed.xml. One other addition you may wish to make is to link to it in your page headers.

It’s simple enough – assuming you’ve made the modifications to make Hugo name your RSS feed “feed.xml”, add the following to your base template somewhere between the <head></head> tags. Obviously there will be a lot more in your page header, but this is simplified for our purposes.

<link rel="alternate" type="application/rss+xml" href='{{ "feed.xml" | absURL }}' />

Now when you view your page source, you’ll see a link to your RSS feed embedded within.

By the way, in case you’re wondering how I did a view source on iPadOS, the answer is a View Source shortcut, which can be found here.