<.RSSLink>: can't evaluate field RSSLink in type *hugolib.pageState after version upgrade 0.91.2 -> v0.94.0+extended linux/amd64

Hello everyone,

I am facing the following issue with the current snap version (v0.94.0+extended linux/amd64) on ubuntu.
Executing hugo server leads to the following error:

render of "page" failed: "/home/website/layouts/_default/baseof.html:33:8": execute of template failed: template: _default/single.html:33:8: executing "_default/single.html" at <.RSSLink>: can't evaluate field RSSLink in type *hugolib.pageState

I did no changes to my side which is still building in my pipeline with version 0.91.2.

I searched everywhere what could have caused this, but after one hour I am still empty handed and at my wits end as unfortunately I also don’t really understand the error message.

This is the only related code to RSSLink I could find in my baseof.html:

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

Which looks how it is supposed to be (judging from the github issues I could find).

My _default/single.html is quite basic:

{{ define "main" }}
<article class="container">
    <main class="bd-content">
{{ .Content }}
    </main>
</article>
{{ end }}

The only way how to get my local hugo development working again that I see is to downgrade the hugo version again, which I would like to avoid. So any help or pointers in the right direction on how to solve this issue would be greatly appreciated!

With 0.91.2 that one should have thrown a warning about a deprecation. With 0.94.0 (or in 0.93, not sure) it was finally removed.

1 Like

The console in previous Hugo versions displayed the following notice regarding .RSSLink:


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 }}

Basically replace instances of .RSSLink with the above construct and the error should be resolved.

4 Likes

Thank you both, for the quick suggestions!
This worked perfectly fine {{ with .OutputFormats.Get “RSS” }}{{ .RelPermalink }}{{ end }}

Somehow I believe there was also some kind of caching issue with the files or the way I was commenting out these lines before. But everything works now, thanks again!

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.