[SOLVED] Upgraded to v 0.21 - "Can't evaluate field RSSLink"


I recently upgraded my site to v0.21, and now can’t serve because the .RSSLink parameter is throwing an error in the header. I didn’t make any changes, and have the boilerplate code in the header partial.

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

hugo serve throws the following error for each page…

ERROR 2017/06/05 11:08:01 Error while rendering "404": template: 404.html:1:3: executing "404.html" at <partial "header.html...>: error calling partial: template: partials/header.html:21:10: executing "partials/header.html" at <.RSSlink>: can't evaluate field RSSlink in type *hugolib.PageOutput

I’m not seeing anything related in the Release Notes, so not sure what’s happening. Any advice would be greatly appreciated. Thanks!

I had the same problem yesterday. Found the solution in the changelogs: you simply have to replace RSSlink by RSSLink.


Aha… that did the trick! Many thanks for the prompt reply.

Same trouble here. My error is closely analogous to yours. But the string RSSLink is already correct in the head.html of my theme.

Oddly, Hugo throws no build errors locally but only in the process of pushing to Gitlab.

Should I post the file? It is short.

<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
<title> {{ .Title }} &middot; {{ .Site.Title }} </title>

<!-- CSS -->
<link rel="stylesheet" href="{{ .Site.BaseURL }}css/slim.css">
<link rel="stylesheet" href="{{ .Site.BaseURL }}css/highlight.min.css">
<link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700|Source+Code+Pro' rel='stylesheet' type='text/css'>
<!-- Icons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/apple-touch-icon-144-precomposed.png">
<link rel="shortcut icon" href="/favicon.ico">

<!-- RSS -->
<link href="{{ .RSSLink }}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" />
1 Like

Do you use {{ if .RSSLink }}?

Thanks for your reply.

Yes I have it in the final line of themes/slim/llayouts/parrtials/head.html.

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

Or do you mean do I use it? As in would I mind losing it?

Had not thought of that.

Yes, I comment out {{ RSSLink }} and bazinga no more Hug build errors on the host.Crude but effective. Lemme see how a new post fares.

Try this code:

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

Tried it. No i.fa.fa-heart.fa-5x but I thank you.