I’ve been working towards fixing the following warning with Hugo in the Pure theme. This warning shows up in other themes as well.
ERROR 2022/01/17 23:19:33 Page.RSSLink is deprecated and will be removed in Hugo 0.93.0. Use the Output Format's link, e.g. something like:
{{ with .OutputFormats.Get "RSS" }}{{ .RelPermalink }}{{ end }}
The code looks like this
{{ if .RSSLink -}}
<link href="{{ .RSSLink }}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" />
<link href="{{ " podcast.xml " | absURL }}" rel="alternate" type="application/rss+xml" title="Podcast" />
<link rel="alternate" type="application/json" title="{{ .Site.Title }}" href="{{ " feed.json " | absURL }}" />
<link rel="EditURI" type="application/rsd+xml" href="{{ " rsd.xml " | absURL }}" />
{{ end -}}
I originally tried to turn it into the following but it wasn’t rendering properly when I sent it to micro.blog.
{{ range .AlternativeOutputFormats -}}
{{ printf `<link href="%s" rel="%s" type="%s" title="%s" />` .Permalink .Rel .MediaType.Type $.Site.Title | safeHTML }}
{{ end -}}
Ultimately, I used the following code.
<!-- RSS etc -->
{{- if .OutputFormats.Get "RSS" -}}
{{- with .OutputFormats.Get "RSS" -}}
<link href="{{ .RelPermalink }}" rel="alternate" type="application/rss+xml" title="{{ $.Site.Title }}" />
<link href="{{ .RelPermalink }}" rel="alternate" type="application/rss+xml" title="{{ $.Site.Title }}" />
<link href="{{ "podcast.xml" | absURL }}" rel="alternate" type="application/rss+xml" title="Podcast" />
<link rel="alternate" type="application/json" title="{{ $.Site.Title }}" href="{{ "feed.json" | absURL }}" />
<link rel="EditURI" type="application/rsd+xml" href="{{ "rsd.xml" | absURL }}" />
{{- end -}}
{{ end -}}
I wanted to have you all look at it for a little bit and ask the question if it is safe to assume that all podcast will have the same URL and should I make the title for the podcast the same as the site title.
Is there a way to find what variables that micro.blog gives to the theme?
Link to branch