Hi,
Hugo server -D was working perfectly until this afternoon. No change has been made to the partials or content. Now I am receiving this error when try to build the site:
Start building sites …
Built in 523 ms
Error: Error building site: failed to render pages: render of “section” failed: “/home/elvis/Web/SF/themes/Belli/layouts/_default/sections.html:15:23”: execute of template failed: template: _default/sections.html:15:23: executing “main” at <.Paginator.Pages>: error calling Pages: runtime error: invalid memory address or nil pointer dereference
This is the line with the error:
{{ range .Paginator.Pages.ByWeight | first 5}}
Now the hugo version is:
Hugo Static Site Generator v0.79.0/extended linux/amd64 BuildDate: 2020-12-17T00:26:40Z
This is the partial template that generate a list of sub sections and post on those sub sections, but now is giving an error on <.Paginator.Pages>
{{ define "main" }}
<section class="section">
{{ $currentSection := .CurrentSection }}
{{ range $section, $taxonomy := .Site.Sections }}
{{if eq $taxonomy.Title $currentSection.Title}}
<h1 class="title is-3 has-text-centered">{{ $taxonomy.Title | title }}</h1>
{{.Content}}
<ul>
{{ range $taxonomy.Pages }}
<hr>
<li class="title is-4"><a href="{{ .Permalink}}"> {{ .LinkTitle }} </a> </li>
{{ .Content }}
<br>
{{if eq (len .Paginator.Pages) 0}}<p class="has-tex-centered has-text-info">Disculpa. Aún estamos desarrollando contenido para esta sección.</p>{{end}}
{{ range .Paginator.Pages.ByWeight | first 5}} **Here is the error!!!**
<article class="media">
<div class="media-content">
<a href="{{ .RelPermalink }}">
<h1 class="title is-6">{{ .Title | title }}</h1>
</a><div class="level is-mobile details">
<div class="level-left">
<div class="level-item">
<p class="subtitle is-7 info date">
{{ partial "traducir-fecha.html" .Date . }}
</p>
</div>
</div>
</div>
</div>
</article>
<br>
{{ end }}
{{end}}
</ul>
{{ end }}
{{ partial "pagination.html"}}{{end}}
</section>
{{ end }}
Any idea or suggestions?