layouts/index.html
:
{{define "main"}}
{{ $products := .Site.RegularPages.ByTitle "Section" "products" }}
{{with .Params.banner}}
[...]
<div class="dropdown-menu">
{{ range (where $products ) }}
<a class="dropdown-item " href="{{ .Permalink }}">{{ .Title }}</a>
{{ end }}
[...]
Produces this error:
ERROR: executing "main" at <.Site.RegularPages.ByTitle>: wrong number of args for ByTitle: want 0 got 2
Okay, so let’s try removing those two (necessary) arguments I guess?
{{ $products := .Site.RegularPages.ByTitle }}
Now, the error says:
ERROR: executing "main" at <where>: wrong number of args for where: want at least 2 got 1
What’s going on here? The first bit of code works in my layouts/header.html
just fine, but now Hugo seems to be confused.