how to combine multiple Site data .Get
{{ $file := .Get "file" }}
{{ $file2 := .Get "file2" }}
{{ $dataFile := index .Site.Data.event (.Get "folder") $file }}
{{ $dataFile2 := index .Site.Data.event (.Get "folder") $file2 }}
how to put together $dataFile
$dataFile2
?
I try to use the append function, but one of the .Get values from (file or file2) is not included an error will appear?
{{ $data := $dataFile | append $dataFile2 }}
<table>
<tr>
{{ range $key, $value := sort $data "title" "desc" }}
<td>{{.title}}</td>
{{ end }}
</tr>
</table>
There is no error when both values are filled in
{{< event folder="java" file="rock" file2="punk" >}}
if
{{< event folder="java" file="rock" >}}
execute of template failed at <append $dataFile2>: error calling append: reflect: call of reflect.Value.Type on zero Value.
thanks, before that