Yes, that is correct. Actually everything works properly and as expected. I was just wondering if it was possible to have a link to /index.xml on all pages using range .OutputFormats. It is also responsivble for non hard coded canonical output. It would have been nice and out of the box to use it for feed and canonical link in all my templates.
I came here trying to do the same thing (I think). I only have 2 feeds enabled for the whole site — RSS and JSON. Both are enabled for just the homepage. I want them in the head of every page, but I don’t want to hard code them. Here’s what I came up with:
{{- with .Site.GetPage "/" }}
{{- range .OutputFormats }}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
{{- end }}
{{- end }}
I recently noticed that on single pages (posts) there is no reference to the main RSS feed (which I want to add) and on category pages or tags pages the title for the RSS feed is exactly as the main feed (which may be confusing and I want to change it).
For example
for /index.xml the RSS title will have the same property as if /categories/blog/index.xml, so decided to change it and come up with the following (in case somebody will need it).
{{ with .OutputFormats.Get "rss" -}}
{{ if eq (absLangURL "") $.Permalink }}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
{{ else }}
{{ $title := (printf "%s (%s)" $.Site.Title $.Title) }}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $title | safeHTML }}
{{ end }}
{{ end -}}
{{ if ne (absLangURL "") $.Permalink }}
{{- with .Site.GetPage "/" }}
{{- with .OutputFormats.Get "rss" }}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
{{- end }}
{{- end }}
{{ end }}