Can't evaluate field RelPermalink in type *hugolib.Node

Hello,

I have his in my partials/header.html:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <base href="{{ .Site.BaseURL }}">

        <!-- Enable responsiveness on mobile devices-->
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">

        <title> {{ .Title }} </title>
        <link rel="canonical" href="{{ .RelPermalink }}">
        {{ partial "head_includes.html" . }}
    </head>

But I get a screen full of

2016/10/11 00:54:30 template.go:132: template: theme/partials/header.html:18:39: executing "theme/partials/header.html" at <.RelPermalink>: can't evaluate field RelPermalink in type *hugolib.Node in theme/partials/header.html
ERROR: 2016/10/11 00:54:30 template.go:132: template: theme/partials/header.html:18:39: executing "theme/partials/header.html" at <.RelPermalink>: can't evaluate field RelPermalink in type *hugolib.Node in theme/partials/header.html
ERROR: 2016/10/11 00:54:30 template.go:132: template: theme/partials/header.html:18:39: executing "theme/partials/header.html" at <.RelPermalink>: can't evaluate field RelPermalink in type *hugolib.Node in theme/partials/header.html
ERROR: 2016/10/11 00:54:30 template.go:132: template: theme/partials/header.html:18:39: executing "theme/partials/header.html" at <.RelPermalink>: can't evaluate field RelPermalink in type *hugolib.Node in theme/partials/header.html
ERROR: 2016/10/11 00:54:30 template.go:132: template: theme/partials/header.html:18:39: executing "theme/partials/header.html" at <.RelPermalink>: can't evaluate field RelPermalink in type *hugolib.Node in theme/partials/header.html

This is my Hugo version: Hugo Static Site Generator v0.18-DEV BuildDate: 2016-10-10T09:22:21-04:00

I am using a modified version of the Lanyon theme for Hugo: https://gitlab.com/kaushalmodi/kaushalmodi.gitlab.io/tree/master/themes/Lanyon/layouts

The difference between the committed code above and above code snippet is the use of {{ .RelPermalink }}.

@bep

Can I please get some help with this?

I hit another issue like this one.

I have below in my layouts/post/single.html:

<div class="post">
    <h1 class="post-title">{{ .Title }}</h1>
   <span class="post-date">{{ .Date.Format .Site.Params.DateForm }}</span>
   {{ .Content }} 
</div>

and I have this in my config.toml:


[Params]
  Title = "A Scripter's Notes"
  Tagline = ""
  DateForm = "Mon Jan 2, 2006"

But still I get these errors:

Started building sites ...
ERROR: 2016/10/12 12:51:11 general.go:212: Error while rendering page post/elisp-meta-characters-in-string.md: template: theme/post/single.html:5:49: executing "theme/post/single.html" at <.Site.Params.DateFor...>: invalid value; expected string
ERROR: 2016/10/12 12:51:11 general.go:212: Error while rendering page post/how-i-created-this-blog.md: template: theme/post/single.html:5:49: executing "theme/post/single.html" at <.Site.Params.DateFor...>: invalid value; expected string

Turns out that the params section needs to be lowercase even though it is referenced as .Site.Params.DateForm from the template HTML code.

I believe .RelPermalink is only relevant for Pages. A Node is different – it’s a section or taxomony listing.

{{ if .IsPage }}<link rel="canonical" href="{{ .RelPermalink }}">{{ end }}