I’ve looked through the other questions on here about passing a variable to a partial, but unfortunately they don’t seem to solve my issue.
In layouts/products/single.html, I have the following:
{{$desc := slice}}
{{range (where (where site.RegularPages "Section" "companies") ".Title" "eq" .Params.company)}}
{{$desc = .Description}}
{{end}}
{{partial "products/description.html" (dict "context" . "desc" $desc)}}
In partials/products/description:
{{.desc}}
This results in the error: can't evaluate field desc in type *hugolib.pageState
.
I don’t understand the error. Can someone please explain what I’m doing wrong?
I’m using v0.61.