Hi, I recently upgraded from Hugo 0.55 to 0.70 and I started getting this warning:
Page.RSSLink is deprecated and will be removed in a future release. Use the Output Format’s link, e.g. something like:
{{ with .OutputFormats.Get “RSS” }}{{ .RelPermalink }}{{ end }}
Fine, so what’s what I did. I replaced the following code:
{{ if .RSSLink }}
<link href="{{ .RSSLink }}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" />
<link href="{{ .RSSLink }}" rel="feed" type="application/rss+xml" title="{{ .Site.Title }}" />
{{ end }}
With this::
{{ with .OutputFormats.Get "RSS" }}{{ .RelPermalink }}{{ end }}
But that causes this “index.xml” label to appear at the top of my homepage:
I tried to keep the <link>
tags in between the first pair of handlebars and the second pair, like this:
{{ with .OutputFormats.Get "RSS" }}{{ .RelPermalink }}{{ end }}
<link href="{{ .RSSLink }}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" />
<link href="{{ .RSSLink }}" rel="feed" type="application/rss+xml" title="{{ .Site.Title }}" />
{{ end }}
But this didn’t compile at all. How can I apply the new syntax to my use case?