New error when generating my website


When I try to generate my website after updating Hugo from 0.74 to 0.80, I get this error :

Error: add site dependencies: load resources: loading templates: “/Users/andrew/quickstart_hs/themes/crab/layouts/_default/list.html:4:1” : parse failed: template: _default/list.html:5: malformed character constant: ‘2006-01-02T15:04:05Z07:00’

I use the theme Crab and don’t remeber having done any customization.

What is the problem, can someone please help me out ?


According to the console message that you posted above, there is a stray character in line 5 of the themes/crab/layouts/_default/list.html template.

Perhaps you opened the template, typed something and saved by accident.

In any case, we cannot really know what is causing this issue, unless you share your project for us to have a look.

And try using manual "" around the date. There might be errors from copypasting the date.

Ok so here is the content of the file :

{{ partial "header.html" . }}

  {{ range sort .Paginator.Pages }}
    <h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
    <time class="post-date" datetime="{{ .Date.Format '2006-01-02T15:04:05Z07:00' | safeHTML }}">{{ .Date.Day }} {{ index $.Site.Data.mois (printf "%d" .Date.Month) }} {{ .Date.Year }} </time>
    <div class="content">
    {{ .Summary | plainify | safeHTML }}
    {{ if .Truncated }}
      ... <a href="{{ .Permalink }}">Read more &hellip;</a>
    {{ end }}
    {{ if .Params.tags }}
      {{ partial "tags" .Params.tags }}
    {{ end }}
  {{ end }}
  {{ partial "pagination.html" . }}

{{ partial "footer.html" . }}

Is this ok like this for you to see and help me ?



' is not " :wink: Exchange those around the date in line 5. It might throw errors in your IDE but it’s ok in the template.

Thanks !

It worked with " instead of `

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