How do I join multiple custom variables into one? I want both to generate a $pages variable to use in RSS feed template. (Where "load regular pages in section blog, and include pages which have a layout of multipage.
{{ $p1 := where site.RegularPages "Section" "blog" }}
{{ $p2 := where site.Pages "Params.layout" "=" "multipage" }}
{{ $pages := <!-- join both --> }}
So the = is useless? I wonder why it was introduced then? Or did := get allowed for reassignments some time later?
I really like the consistency in definition:
:= for declarations or first assignments
= for reassignments
Update: OK, I get it. Using := for both initial and later assignments works in the case of $pages in this thread because the redefinition is happening in the same scope as the initial assignment.
In the documentation, I think that that convention should be followed (use = for redefinition) for clarity. If the user does := instead of = in that variable redefinition example in the above linked doc, they might be surprised by the outcome.