Hi ,
I’m new to Hugo and I have an issue, when I runserver
my if statement throws the following error.
Error: Error building site: failed to render pages: render of "taxonomyTerm" failed: "C:\projects\travel-log\themes\travel-log\layouts\_default\list.html:1:1": execute of template failed: panic in Execute: runtime error: invalid memory address or nil pointer dereference. See "https://github.com/gohugoio/hugo/issues/5327" for the reason why we cannot provide a better error message for this.
If I remove my if statement, my webserver start. Then if I add back my if statement, I don’t have any error and the code does what I expect . I’m running Hugo v0.51 on Windows 10.
Not really sure what I’m doing wrong. Basically, I try to list out all the descendant posts from my list page.
{{ $thisPage := .CurrentSection }}
{{ range .Site.RegularPages }}
{{ if .IsDescendant $thisPage}}
<li>
<a href="{{ .URL }}">{{ .Title }}</a>
</li>
{{ end }}
{{ end }}
Code is in the rebuild branch of this repo https://github.com/vinceumo/travel-log/tree/rebuild
Thanks for the help