Assigning string concate inside a loop

I think what you mean to do here is:

$metadata | append (printf "| %v | %v \n" $key $value) or similar.

The way you had it $metadata was being fed to the printf as a parameter after $key and $value, and that resulting third parameter was 'extra` leading to the output.

Check out the Hugo Docs for Pipes:

Which are Go Pipes:

1 Like