What is {{ .RSSlink }}, exactly?

Hi - worked today on incorporating html5boilerplate techniques into my site, and got a little confused when it came to specifying the .RSSlink, so I’d like to ask for come comments on a couple of things:

What is .RSSlink exactly? It appears we do not have to set it anywhere, but rather, that it is a built-in variable (a boolean?) that we can use to check for the existence of a RSS file on a given page. Like the index page or a category page.

Is that understanding correct?

Secondly, I notice that the default inside the rss template is Atom. Is there a reason to not use the typical atom markup?

{{ if .RSSlink }}
<link href="{{ .RSSlink }}" rel="alternate" type="application/atom+xml" title="{{ .Site.Title }}" />
<link href="{{ .RSSlink }}" rel="feed" type="application/atom+xml" title="{{ .Site.Title }}" />
{{ end }}

… I ask because the above was not the typical method cited here and there.

My intention is, if I can understand this better, to edit the docs a little.


1 Like

There are plenty of discussions about Atom vs whatever on GitHub.

.RSSlink is a URL to the RSS feed in the given context, /index.xml /posts/index.xml … You can change the name by setting the RSSUri config variable.

… thinking about it, I believe there are some pieces missing with that RSSUri … see https://github.com/spf13/hugo/issues/1147

Hi @bjornerik, indeed there are a lot of discussions. I was thrown by the Atom namespace in the default Hugo feed, but on review after some sleep, it has the <channel> tag, and, apparently RSS 2 supports an Atom namespace.

Thanks for the info on RSSlink and RSSUri.

@bjornerik I didn’t touch rssuri but made a general edit and PR on this. FYI